You have pretty much nailed it except that these options are picked up even if you start JVM in-process via a library call.

The fact that _JAVA_OPTIONS is not documented suggests that it is not recommended to use this variable, and I've actually seen people abuse it by setting it in their ~/.bashrc. However, if you want to get to the bottom of this problem, you can check the source of Oracle HotSpot VM (e.g. in OpenJDK7).

You should also remember that there is no guarantee other VMs have or will continue to have support for undocumented variables.

UPDATE 2015-08-04: To save five minutes for folks coming from search engines, _JAVA_OPTIONS trumps command-line arguments, which in turn trump JAVA_TOOL_OPTIONS.

Answer from mkalkov on Stack Overflow
🌐
GitHub
github.com › travis-ci › travis-cookbooks › issues › 895
Use JAVA_TOOL_OPTIONS instead of _JAVA_OPTIONS · Issue #895 · travis-ci/travis-cookbooks
August 31, 2017 - In #885 we introduced _JAVA_OPTIONS in an attempt to control JVM memory allocation. Documentation suggests that JAVA_TOOL_OPTIONS is actually recommended for these cases. The difference is pretty n...
Author   travis-ci
🌐
Baeldung
baeldung.com › home › devops › catalina_opts vs. java_opts in apache tomcat
CATALINA_OPTS vs. JAVA_OPTS in Apache Tomcat | Baeldung
January 8, 2024 - CATALINA_OPTS is an env variable that allows us to customize Apache server-related configurations. Unlike JAVA_OPTS, which is primarily used to configure JVM-related options, CATALINA_OPTS mainly configure Tomcat server-related configurations.
🌐
ProgrammerZero Blog
programmerzero.hashnode.dev › javaopts-vs-javaoptions-vs-javatooloptions-whats-the-difference
Java ENV Variables: Key Differences - ProgrammerZero Blog
December 9, 2024 - Instead, it’s the tool’s start-up scripts that interpret it and pass the options to the JVM. Example Use Case: Let’s say you’re running Oracle WebLogic and need to configure SSL settings. Instead of modifying WebLogic’s config files, we can set: JAVA_OPTIONS="-Dweblogic.security.SSL.ignoreHostnameVerification=true"
🌐
Medium
hritikchaudhary.medium.com › the-difference-between-java-opts-and-catalina-opts-in-tomcat-c8ad082806a8
The difference between JAVA_OPTS and CATALINA_OPTS in Tomcat? | by Hritik Chaudhary | Medium
November 16, 2021 - So the first different between the two is anything specified in EITHER variable is passed, identically, to the command that starts up Tomcat — the “start” or “run” command — but only values set in JAVA_OPTS are passed to the “stop” command...
🌐
Codemia
codemia.io › home › knowledge hub › difference between _java_options, java_tool_options and java_opts
Difference between _JAVA_OPTIONS, JAVA_TOOL_OPTIONS and JAVA_OPTS | Codemia
January 27, 2025 - Like JAVA_TOOL_OPTIONS, it prints a stderr message confirming pickup. Because it overrides explicit arguments, it can silently change behavior that was intentionally set on the command line. It is HotSpot-specific. IBM J9, GraalVM native-image, and other non-HotSpot JVMs may not recognize it. This variable is not recognized by the JVM. It exists purely as a convention in startup scripts. ... export JAVA_OPTS="-Xmx1024m -Xms512m" ./catalina.sh start # Tomcat reads JAVA_OPTS in its script java -jar myapp.jar # This process ignores JAVA_OPTS entirely
🌐
DEV Community
dev.to › sunnybhambhani › different-environment-variables-available-in-java-101o
Different environment variables available in Java - DEV Community
January 3, 2026 - JAVA_OPTS: >JAVA_OPTS is not an environment variable that the java executable will recognise on its own.
🌐
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.
Find elsewhere
🌐
Stack Overflow
stackoverflow.com › questions › linked › 2011311
Hot Linked Questions - Stack Overflow
I have set the Environment variable JAVA_OPTS (-Dappconfig=D:/cc/dd -Dfarm=test and want to read properties from a property using the following code but no matter what I tried I got the error below.
🌐
Metabase
discourse.metabase.com › get help
JVM env var on Docker: JAVA_TOOL_OPTIONS or JAVA_OPTS? - Get Help - Metabase Discussion
October 5, 2022 - Hello, I have a deployment using the official Docker image (metabase/metabase) and I'm a bit confused about which environment variable I should use to control JVM options. I see different references to JAVA_TOOL_OPTIONS and to JAVA_OPTS. My final goal is to pass something like -Xmx8g to it.
🌐
CircleCI
circleci.com › blog › how-to-handle-java-oom-errors
How to Handle Java OOM Errors - CircleCI
December 6, 2017 - It’s read by all Java virtual machines and is easily overridden, either with command-line arguments or, depending on your build tool, more specific environment variables. It’s also better at handling quotes than _JAVA_OPTIONS. JAVA_OPTS Somewhat misleadingly, JAVA_OPTS isn’t actually read by the JVM, but rather used by a variety of common Java-based tools/languages to pass memory limits to the JVM.
🌐
javaspring
javaspring.net › blog › difference-between-java-options-java-tool-options-and-java-opts
Difference Between _JAVA_OPTIONS, JAVA_TOOL_OPTIONS, and JAVA_OPTS: JVM Environment Variables Explained — javaspring.net
Without such a script, JAVA_OPTS has no effect. Non-standard: Not defined by the JVM specification; behavior depends on the script. Tool-specific: Only affects the java launcher (and only if the script forwards it). No built-in precedence: Options in JAVA_OPTS are treated like command-line arguments, so they can be overridden by explicit command-line options.
🌐
CodingTechRoom
codingtechroom.com › question › difference-between-java-opts-and-java-tool-options
What is the Difference Between JAVA_OPTS and JAVA_TOOL_OPTIONS? - CodingTechRoom
JAVA_TOOL_OPTIONS applies globally and can affect all Java applications executed in the current environment. Use JAVA_OPTS for application-specific arguments such as heap size adjustments or garbage collection settings.
🌐
Iditect
iditect.com › faq › java › difference-between-javaoptions-javatooloptions-and-javaopts.html
Difference between _JAVA_OPTIONS, JAVA_TOOL_OPTIONS and JAVA_OPTS
_JAVA_OPTIONS and JAVA_TOOL_OPTIONS are more focused on setting default JVM options and are system-wide settings. JAVA_OPTS is commonly used in the context of application servers and servlet containers to configure Java options specifically for applications deployed within that container.
🌐
DEV Community
dev.to › azure › a-better-way-to-tune-the-jvm-in-dockerfiles-and-kubernetes-manifests-329c
A Better Way to Tune the JVM in Dockerfiles and Kubernetes Manifests - DEV Community
September 12, 2025 - If you’re running Java apps in Docker or Kubernetes, stop hardcoding JVM flags into your command line. Use JDK_JAVA_OPTIONS instead.
🌐
Devgex
devgex.com › en › article › 00039899
Comprehensive Analysis of _JAVA_OPTIONS, JAVA_TOOL_OPTIONS, and JAVA_OPTS: Roles and Differences in JVM Parameter Configuration - DevGex
December 4, 2025 - Abstract: This paper systematically examines the operational mechanisms and core distinctions among three environment variables—_JAVA_OPTIONS, JAVA_TOOL_OPTIONS, and JAVA_OPTS—in Java Virtual Machine parameter configuration.
🌐
Blogger
thompsonng.blogspot.com › 2016 › 08 › java-javaoptions-and-javatooloptions.html
JAVA - _JAVA_OPTIONS and JAVA_TOOL_OPTIONS environment variable
August 9, 2016 - 3. Support - _JAVA_OPTIONS is Oracle specific. The IBM Java equivalent will be IBM_JAVA_OPTIONS. JAVA_TOOL_OPTIONS is platform independent. Reference: 1. JAVA_TOOLS_OPTIONS 2. IBM_JAVA_OPTIONS 3. http://stackoverflow.com/questions/28327620/...
🌐
GATK
gatk.broadinstitute.org › hc › en-us › community › posts › 5036300695195-Environment-JAVA-OPTS-are-ignored
Environment JAVA_OPTS are ignored – GATK
March 30, 2022 - We took a look - our tool launcher seems to append to the environment java options, so what you're seeing should not be happening. We think this issue might be due to using the wrong java options environment variable for your system. What version of java do you have?