You can use

java -XX:+UnlockDiagnosticVMOptions -XX:+PrintFlagsFinal -version

to print all options and their defaults. If you have a debug build you can use this command to print comments for the various options as well:

java -XX:+UnlockDiagnosticVMOptions -XX:+UnlockExperimentalVMOptions -XX:+PrintFlagsFinal -XX:+PrintFlagsWithComments -version

PS: There are descriptions for most of them in this blog post: http://stas-blogspot.blogspot.bg/2011/07/most-complete-list-of-xx-options-for.html

Answer from Svetlin Zarev on Stack Overflow
🌐
JRebel
jrebel.com › blog › jvm-options-cheat-sheet
JVM Options Cheat Sheet | JRebel by Perforce
In this post, we cover some of the popular Java options available at the command line, including standard, non-standard, and advanced JVM options.
🌐
Oracle
docs.oracle.com › en › java › javase › 22 › docs › specs › man › java.html
The java Command
July 16, 2024 - Optional: Arguments following mainclass, source-file, -jar jarfile, and -m or --module module/mainclass are passed as arguments to the main class. The java command starts a Java application. It does this by starting the Java Virtual Machine (JVM), loading the specified class, and calling that ...
Discussions

Java's Options for Options
I was hoping for a nice solution at the end but instead I was left with disappointment. 10/10 good read. More on reddit.com
🌐 r/java
82
192
February 8, 2022
java - Difference between _JAVA_OPTIONS, JAVA_TOOL_OPTIONS and JAVA_OPTS - Stack Overflow
I thought it would be great to have a comparison between _JAVA_OPTIONS and JAVA_TOOL_OPTIONS. I have been searching a bit for one, but I cannot find anything, so I hope we can find the knowledge he... More on stackoverflow.com
🌐 stackoverflow.com
JAVA_OPTIONS cannot be set in docker-compose.yml
Current Behavior I am trying to limit the RAM the api server uses with docker-compose. Currently it uses 90% RAM which is not desired (I dont use docker swarm, therefore the resource limits do not work). When setting JAVA_OPTIONS or EXTR... More on github.com
🌐 github.com
4
January 4, 2024
Why does the environment variable _JAVA_OPTIONS exist, applies to jlink images, takes precedence, and can't be disabled?
Because sometimes the user wants to override command line options. The application being able to disable it would defeat the entire point. Anyways, as another person stated, if someone malicious has access to your home directory, you have bigger problems. Especially since things like LD_PRELOAD exist. More on reddit.com
🌐 r/java
43
2
May 4, 2024
🌐
Apache Commons
commons.apache.org › proper › commons-cli › javadocs › api-release › org › apache › commons › cli › Options.html
Options (Apache Commons CLI 1.3.1 API)
Options represents a collection of Option objects, which describe the possible options for a command-line · It may flexibly parse long and short options, with or without values. Additionally, it may parse only a portion of a commandline, allowing for flexible multi-stage parsing
🌐
Jedit
jedit.org › users-guide › jvm-options.html
Java Virtual Machine Options
There is no complete list of options to java, since it can vary from one platform to another. Some of can be found by typing the commands java -? or man java.
🌐
Reddit
reddit.com › r/java › java's options for options
r/java on Reddit: Java's Options for Options
February 8, 2022 - I've read in this very subreddit anecdote from user who uses Optional in his code base literally everywhere: fields, local variables, arguments, etc. It is a huge code base and plenty of people work on it. He said that it did not cause any issues including performance issues and basically solved missing gap in Java type system for nullable types.
Find elsewhere
🌐
GitHub
github.com › DependencyTrack › dependency-track › issues › 3350
JAVA_OPTIONS cannot be set in docker-compose.yml · Issue #3350 · DependencyTrack/dependency-track
January 4, 2024 - Setting '- JAVA_OPTIONS="-XX:+UseParallelGC -XX:MaxRAMPercentage=33.0"' and ' - EXTRA_JAVA_OPTIONS="-XX:+UseParallelGC -XX:MaxRAMPercentage=33.0"'
Author   DependencyTrack
🌐
IBM
ibm.com › docs › en › sdk-java-technology › 8
Specifying Java options and system properties - IBM Documentation
January 22, 2026 - Specify options or system properties on the command line, as shown in the following example: java -Dmysysprop1=tcpip -Dmysysprop2=wait -Xdisablejavadump MyJavaClass
🌐
ProgrammerZero Blog
programmerzero.hashnode.dev › javaopts-vs-javaoptions-vs-javatooloptions-whats-the-difference
Java ENV Variables: Key Differences
December 9, 2024 - JVM offers various customizations like memory allocations, garbage collection strategies and debugging options for JAVA Applications. Environmental variables like JAVA_OPTS , JAVA_OPTIONS & JAVA_TOOL_OPTIONS helps us achieve this. BUTTTT here’s the catch!!
🌐
Oracle
docs.oracle.com › cd › E14592_01 › doc.10142 › e14608 › app_orminweblogic.htm
Manual Configuration of WebLogic Server
set JAVA_OPTIONS=%JAVA_OPTIONS% -Dlog4j.configuration=file:C:/bea/user_projects/domains/orm_domain/log4j.properties
🌐
IBM
ibm.com › docs › fi › sdk-java-technology › 8
Specifying Java options and system properties
You can specify Java options and system properties directly on the command line. You can also use an options file or an environment variable.
🌐
Eclipse Foundation
eclipse.dev › openj9 › docs › cmdline_specifying
Specifying options -
Do not use '-X<option>' or "-X<option>". Instead, you must use -X<option>. For example, do not use '-Xmx500m' and "-Xmx500m". Write this option as -Xmx500m. The sequence of the Java options on the command line defines which options take precedence during startup.
🌐
TheServerSide
theserverside.com › blog › Coffee-Talk-Java-News-Stories-and-Opinions › jvm-options-java-parameters-command-line-environment-variable-list-xms-xmx-memory
Critical Java JVM options and parameters
The manner in which the JVM manages the Eden space, the Tenured space and even the PermGen space can be configured through JVM options as follows: -XX:MaxPermSize -XX:PermSize -XX:NewSize -XX:MaxNewSize -XX:SurvivorRatio -XX:MaxTenuringThreshold · The JVM also provides a number of print methods that simply allow you to view the status of the Java runtime.
🌐
Baeldung
baeldung.com › home › java › core java › what is the difference between jdk_java_options and java_tool_options?
What Is the Difference Between JDK_JAVA_OPTIONS and JAVA_TOOL_OPTIONS? | Baeldung
February 28, 2025 - We often need to pass JVM options without modifying our scripts when configuring Java applications. Instead of manually adding flags every time we run the java command, we can use the environment variables JDK_JAVA_OPTIONS or JAVA_TOOL_OPTIONS.
🌐
Reddit
reddit.com › r/java › why does the environment variable _java_options exist, applies to jlink images, takes precedence, and can't be disabled?
r/java on Reddit: Why does the environment variable _JAVA_OPTIONS exist, applies to jlink images, takes precedence, and can't be disabled?
May 4, 2024 -

I just spent a good chunk of time debugging an issue because a user had set _JAVA_OPTIONS to use a low Xmx value in their environment variables. This was an application created with jpackage, which should be fully standalone. It even had a custom Xmx value set in the JVM arguments for the image but the environment variable overwrote the value!

Isn't this like a huge design flaw? I can just do echo "_JAVA_OPTIONS=<Wacky VM options>" >> ~/.bashrc or setx to break literally every Java application on the system? (Edit: Maybe the initial security focus was wrong, changed it a bit to focus more on the design issues)

Who even thought that this would be a good idea with no option to disable this behavior?

🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › javax › swing › text › html › Option.html
Option (Java Platform SE 8 )
April 21, 2026 - Java™ Platform Standard Ed. 8 ... Value for the ListModel used to represent <option> elements.
🌐
Squiz
docs.squiz.net › funnelback › docs › latest › reference › configuration-options › collection-options › java_options.html
java_options :: Squiz DXP Help Center
This option allows you to set command-line options to the JVM. For example, to increase stack space, etc. This will be used when launching most of the Java based components in Funnelback.
🌐
Baeldung
baeldung.com › home › java › jvm › exploring advanced jvm options
Exploring Advanced JVM Options | Baeldung
January 16, 2025 - The Java Virtual Machine (JVM) is a powerful engine that powers Java applications. It is highly customizable and provides basic configuration through standard options, general performance tuning through non-standard options, and precise control through advanced options.
🌐
Oracle
docs.oracle.com › javase › 8 › docs › technotes › tools › unix › java.html
java
April 21, 2026 - If the option -agentlib:foo is specified, then the JVM attempts to load the library named libfoo.so in the location specified by the LD_LIBRARY_PATH system variable (on OS X this variable is DYLD_LIBRARY_PATH). The following example shows how to load the heap profiling tool (HPROF) library and get sample CPU information every 20 ms, with a stack depth of 3: ... The following example shows how to load the Java Debug Wire Protocol (JDWP) library and listen for the socket connection on port 8000, suspending the JVM before the main class loads: