Legacy mode

Jesse Glick jesse.glick at oracle.com
Thu Sep 22 08:04:55 PDT 2011


On 09/12/2011 10:19 AM, Alan Bateman wrote:
> We don't have an exact equivalent [to -Xbootclasspath/p] in module mode.

FWIW - in the NetBeans module system there is a convention that for a module $dir/$symbname.jar you can create $dir/patches/$symbname/*.jar whose contents can override 
the classes in the module JAR. This makes it straightforward to temporarily patch a class or two, for testing purposes or a "hot fix", without rebuilding the module. The 
(immediate) parent directory of the patch JAR indicates which module is being patched; the patch JAR basename can be anything you like, making it easy to create multiple 
patches for different purposes (e.g. two different hot fixes).

Obviously some details would have to be different for use with JDK modules. You could imagine -Xmodulepatches:/tmp/patches where 
/tmp/patches/jdk.nio/1.0/java/nio/Buffer.class would override java.nio.Buffer in jdk.nio at 1.0. (This is assuming that the module system forbids >1 copy of the same version 
of the same module to be loaded at once, unlike the upcoming OSGi spec if I understand correctly; or at least that such a situation is rare and -Xmodulepatches need not 
support it.)



More information about the jigsaw-dev mailing list