Skip to content

Commit

Permalink
Use system path separator to split boot: and sys: arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
adinn committed Mar 6, 2023
1 parent 59ed6c6 commit 1e62c5e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions agent/src/main/java/org/jboss/byteman/agent/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,16 @@ public static void premain(String args, Instrumentation inst)
// listener flag which implies use of a retransformer
for (String arg : argsArray) {
if (arg.startsWith(BOOT_PREFIX)) {
// boot argument can be a single jar or a ':' separated list of jars
// boot argument can be a single jar or a ':' or ';' separated list of jars
String bootArg = arg.substring(BOOT_PREFIX.length(), arg.length());
String[] jarNames = bootArg.split(":");
String[] jarNames = bootArg.split(File.pathSeparator);
for (String jarName : jarNames) {
bootJarPaths.add(jarName);
}
} else if (arg.startsWith(SYS_PREFIX)) {
// sys argument can be a single jar or a ':' separated list of jars
// sys argument can be a single jar or a ':' or ';' separated list of jars
String sysArg = arg.substring(SYS_PREFIX.length(), arg.length());
String[] jarNames = sysArg.split(":");
String[] jarNames = sysArg.split(File.pathSeparator);
for (String jarName : jarNames) {
sysJarPaths.add(jarName);
}
Expand Down
4 changes: 2 additions & 2 deletions docs/asciidoc/src/main/asciidoc/chapters/Using-Byteman.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ Byteman agent dynamically. It expects to find the JBoss Modules plugin
jar in directory `$BYTEMAN_HOME/contrib/jboss-modules-system`.

*sys:jarpath* where _jarpath_ is a path to to a jar file to be added to the JVM _system_ class
path, e.g. `sys:/path/to/my.jar`, or a colon separated list of paths if more than one jar
path e.g. `sys:/path/to/my.jar`, or a list of paths separated by the system path separator (`:` on Linux and MacOS, `;` on Windows) if more than one jar
file is to be appended, e.g. `sys:/path/to/my.jar:/path/to/another.jar`.
This option makes classes contained in the jar file(s) available for use when type checking,
compiling and executing rule conditions and actions. It provides a useful way to ensure that
Expand All @@ -284,7 +284,7 @@ to the Helper class should resolve correctly.


*boot:jarfile* where _jarfile_ is a path to to a jar file to be added to the JVM _bootstrap_ class
path e.g. `sys:/path/to/my.jar`, or a colon separated list of paths if more than one jar
path e.g. `sys:/path/to/my.jar`, or a list of paths separated by the system path separator (`:` on Linux and MacOS, `;` on Windows) if more than one jar
file is to be appended, e.g. `sys:/path/to/my.jar:/path/to/another.jar`.
This option provides a similar facility to the sys option but it ensures that the classes
contained in the jar file(s) are loaded by the bootstrap class loader. This is only significant when
Expand Down

0 comments on commit 1e62c5e

Please sign in to comment.