Skip to content

Commit 13e4501

Browse files
committed
fix: Abort on IBMJ9's keytool
1 parent 42f154d commit 13e4501

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

dd-java-agent/src/main/java/datadog/trace/bootstrap/AgentBootstrap.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,20 @@ private static boolean isJdkTool() {
253253
return true;
254254
}
255255
}
256+
// Handles IBMJ9 tools
257+
String command = SystemProperties.get("sun.java.command");
258+
if (null != command && !command.isEmpty()) {
259+
// substring on first space
260+
String mainClass = command;
261+
int firstSpace = command.indexOf(' ');
262+
if (firstSpace != -1) {
263+
mainClass = command.subSequence(0, firstSpace).toString();
264+
}
265+
switch (mainClass) {
266+
case "com.ibm.crypto.tools.KeyTool": // keytool
267+
return true;
268+
}
269+
}
256270
return false;
257271
}
258272

0 commit comments

Comments
 (0)