On 04/06/2016 12:10, Remi Forax wrote:

Hi Mandy,
did you think about using -J for specifying either VM options or module options 
(the user really don't care) for custom launchers like we use -J to specify VM 
option to javac ?

If "custom launcher" means the JNI innovation API then you won't be using -J, instead you'll specify the VM options via the JavaVMInitArgs when creating the VM .Then you'll load and invoke the entry point for the tool, maybe specifying options to its entry/main method. To date then creating the VM has required specifying these options via the non-documented/internal properties so this patch addresses this.

On the other hand, if you mean launching javac or other tools, say with ProcessBuilder, then -J should just work as it does now. Also as you mention javac then it's important to distinguish the options for the compilation environment from the options for the underlying runtime environment. One could find oneself doing something doing something like `javac -J-addmods -Jfoo -addmods bar ...` for example. It gets more fun once you the annotation processing environment into the picture.

Just to put more context on this patch. We are cleaning up the command line option handling and trying to get things more consistent. It will take a number of steps. One of the patches to proceed this one is an entry point that javac can use to pick up the runtime options. There is also a recent javac change to pick up options from an environment variable in a similar (but not identical) way to _JAVA_OPTIONS. Once all the pieces are in then I think the command line option story will be much better.

-Alan

Reply via email to