The only doc for -Xpatch I can find is $ java -X |& grep -A2 Xpatch -Xpatch:<module>=<file>(:<file>)* Override or augment a module with classes and resources in JAR files or directories
BUT that syntax appears to have no effect, e.g. if I try java -Xpatch:java.base=$CLASSES that seems to have no effect, whatever the value of $CLASSES, and there is no warning/error if $CLASSES doesn't exist in the filesystem, which seems like a bug. Currently java -Xpatch:$CLASSES does work, but only if $CLASSES is a directory, not a jar file, which seems like a bug. If I have two separate -Xpatch flags, then I get: $ java -Xpatch:junk -Xpatch:junk -help Error occurred during initialization of VM java.lang.ExceptionInInitializerError at java.lang.module.SystemModuleFinder.<clinit>(java.base/SystemModuleFinder.java:129) at java.lang.module.ModuleFinder.ofSystem(java.base/ModuleFinder.java:165) at jdk.internal.module.ModuleBootstrap.boot(java.base/ModuleBootstrap.java:98) at java.lang.System.initPhase2(java.base/System.java:1916) Caused by: java.lang.IllegalArgumentException: Unable to parse: junk at jdk.internal.module.ModulePatcher.throwIAE(java.base/ModulePatcher.java:583) at jdk.internal.module.ModulePatcher.decodeProperties(java.base/ModulePatcher.java:97) at jdk.internal.module.ModulePatcher.<clinit>(java.base/ModulePatcher.java:73) at java.lang.module.SystemModuleFinder.<clinit>(java.base/SystemModuleFinder.java:129) at java.lang.module.ModuleFinder.ofSystem(java.base/ModuleFinder.java:165) at jdk.internal.module.ModuleBootstrap.boot(java.base/ModuleBootstrap.java:98) at java.lang.System.initPhase2(java.base/System.java:1916) I expect to get "Unable to parse: junk" even with just a single -Xpatch:junk, but I don't. I might have filed bugs, but I don't know where.