Review Request JDK-8136930 Examine implications for custom launchers, equivalent of java -X options in particular

Coleen Phillimore coleen.phillimore at oracle.com
Fri Jun 10 14:18:29 UTC 2016



On 6/4/16 7:46 AM, Alan Bateman wrote:
> 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.

Why not just document these properties?  This changeset gives them 
expected names.   There are other documented properties.

https://docs.oracle.com/javase/8/docs/api/java/lang/System.html#getProperties--

These properties should be documented in any case.

>
> 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.

I was wondering this also.  In order to pass -addmods to the JVM, you do 
this:

javac -J-addmods -Jmodname -J-more options.

Another fun thing you can do is  this:

javac -J-addmods -J-XX:VMOptionsFile=x -J-moreoptions

And have the file x contain the name of the module.  Intended?

What is the error message that you get when you miss out the module name?

java -addmods -XX:-UseCompressedOops ?

Does it say that the module name has been omitted or does it pass 
-XX:-UseCompressedOops as a property to the jdk.

Of course, the -XX:+IgnoreUnrecognizedVMOptions  problem is going to 
require additional hacks in the jvm.

>
> 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.

I think this makes it less consistent and is there an open review and 
discussion about an entry point for javac to pick up the runtime 
options?  What would javac do with the -XX options?

Thanks,
Coleen

>
> -Alan



More information about the hotspot-runtime-dev mailing list