java – Information about _JAVA_OPTIONS

java – Information about _JAVA_OPTIONS

You can use _JAVA_OPTIONS to pass options to any JVM process started on your system.

For example,

set _JAVA_OPTIONS=-Dsun.java2d.noddraw=true

When a JVM starts, it parses the value of _JAVA_OPTIONS as if the parameters were at the command line of java. You can see the passed parameters via JVisualVM.

For more information, read the blog post:
What I discovered while trying to pass Default JVM Parameters

And according to undocumented Hotspot-specific _JAVA_OPTIONS was superseded by JAVA_TOOL_OPTIONS that is included in standard JVMTI specification, does better handling of quoted spaces and should be always preferred.

Since JDK 9+ theres also JDK_JAVA_OPTIONS as the preferred replacement, see What is the difference between JDK_JAVA_OPTIONS and JAVA_TOOL_OPTIONS when using Java 11?

java – Information about _JAVA_OPTIONS

Leave a Reply

Your email address will not be published. Required fields are marked *