As mentioned in the other questions, you get that warning if starting any java process when the JAVA_TOOL_OPTIONS environment variable is declared. This is mentioned in Windows Android Studio logs on start-up, and also if you run java -version from a terminal / cmd.exe.

Before removing first check whether you need these addition settings or not. The setting -Dfile.encoding=UTF8 is default for JDK19 onwards, but not for earlier JDKs and fixing to avoid an Android Studio warning might cause unexpected changes elsewhere with other Java based applications on pre-JDK19.

Two places I know where it could be defined:

  1. Settings > System > About > Advanced System Settings -> Environment Variables:

    Delete JAVA_TOOL_OPTIONS values under your user settings or System settings.

    This setting can be added back by re-entering in the dialog or typing command: setx JAVA_TOOL_OPTIONS blah.

    Don't forget to close/re-open Windows Terminal or CMD.EXE after making changes to the environment variables or they won't see the new values.

  2. As a local variable in CMD.EXE. This setting may have been added by some init script (say if you use CMD.EXE /k init.cmd) calling set JAVA_TOOL_OPTIONS=blah and this overrides / replaces 1) value.

    You may be able to remove with set JAVA_TOOL_OPTIONS= and re-running java or Android Studio from that CMD, but note that the original value will be restored after close/re-open CMD if it was set in 1) already.

There is no doubt an easier way to do this as annoyingly it adds a blank cmd terminal: if you wished to disable for just Android Studio you could set up an alternative windows shortcut with this as "Target" field (do no add any extra spaces):

cmd.exe /c set JAVA_TOOL_OPTIONS=&&"C:\Program Files\Android\Android Studio\bin\studio64.exe"

Note:

  • setx VARNAME NEWVALUE does not need "=" sign.
  • set VARNAME=NEWVALUE requires the "=" sign
Answer from DuncG on Stack Overflow
🌐
Oracle
docs.oracle.com › javase › 8 › docs › technotes › guides › troubleshoot › envvars002.html
The JAVA_TOOL_OPTIONS Environment Variable
April 21, 2026 - When this environment variable ... argument. This environment variable allows you to specify the initialization of tools, specifically the launching of native or Java programming language agents using the -agentlib or -javaagent options....
Top answer
1 of 2
4

As mentioned in the other questions, you get that warning if starting any java process when the JAVA_TOOL_OPTIONS environment variable is declared. This is mentioned in Windows Android Studio logs on start-up, and also if you run java -version from a terminal / cmd.exe.

Before removing first check whether you need these addition settings or not. The setting -Dfile.encoding=UTF8 is default for JDK19 onwards, but not for earlier JDKs and fixing to avoid an Android Studio warning might cause unexpected changes elsewhere with other Java based applications on pre-JDK19.

Two places I know where it could be defined:

  1. Settings > System > About > Advanced System Settings -> Environment Variables:

    Delete JAVA_TOOL_OPTIONS values under your user settings or System settings.

    This setting can be added back by re-entering in the dialog or typing command: setx JAVA_TOOL_OPTIONS blah.

    Don't forget to close/re-open Windows Terminal or CMD.EXE after making changes to the environment variables or they won't see the new values.

  2. As a local variable in CMD.EXE. This setting may have been added by some init script (say if you use CMD.EXE /k init.cmd) calling set JAVA_TOOL_OPTIONS=blah and this overrides / replaces 1) value.

    You may be able to remove with set JAVA_TOOL_OPTIONS= and re-running java or Android Studio from that CMD, but note that the original value will be restored after close/re-open CMD if it was set in 1) already.

There is no doubt an easier way to do this as annoyingly it adds a blank cmd terminal: if you wished to disable for just Android Studio you could set up an alternative windows shortcut with this as "Target" field (do no add any extra spaces):

cmd.exe /c set JAVA_TOOL_OPTIONS=&&"C:\Program Files\Android\Android Studio\bin\studio64.exe"

Note:

  • setx VARNAME NEWVALUE does not need "=" sign.
  • set VARNAME=NEWVALUE requires the "=" sign
2 of 2
0

In terminal type; printenv to see environment variables. Scroll down slowly then you will see the _JAVA_OPTIONS Type; unset _JAVA_OPTIONS Then Type printenv lastly and you will not see it there anymore. Restart your pc before launching pycharm.

🌐
Real's HowTo
rgagnon.com › javadetails › java-set-java-properties-system-wide.html
Set default value for a java property (system wide) - Real's Java How-to
If the Java process is launch via javaw.exe (Applet) then the environment variable is called _JPI_VM_OPTIONS. ... For a Java Web Start process (javaws.exe), the environment variable is called JAVAWS_VM_ARGS. ... JAVAWS_VM_ARGS = -Dsome.property=true ref : http://docs.oracle.com/javase/7/docs/webnotes/tsg/TSG-Desktop/html/plugin.html#gcexdd · But .. The preferred way is to use an environment called JAVA_TOOL_OPTIONS.
🌐
JetBrains
intellij-support.jetbrains.com › hc › en-us › community › posts › 360009528999-JAVA-TOOL-OPTIONS-Rider-error
JAVA_TOOL_OPTIONS Rider error – IDEs Support (IntelliJ Platform) | JetBrains
August 24, 2020 - I had the same problem. In my case, the environment variable was _JAVA_OPTIONS. IntelliJ kept showing me the message despite having removed it from the environment variables. The way I could finally request it was: - Close IntelliJ. - Open a CMD window in windows.
🌐
Blogger
thompsonng.blogspot.com › 2016 › 08 › java-javaoptions-and-javatooloptions.html
JAVA - _JAVA_OPTIONS and JAVA_TOOL_OPTIONS environment variable
August 9, 2016 - JAVA_TOOL_OPTIONS and _JAVA_OPTIONS are 2 useful environment variables which allow user to set JVM options in the form of environment varia...
🌐
GitHub
github.com › qjebbs › vscode-plantuml › issues › 19
Diagram error when env variable JAVA_TOOL_OPTIONS is defined · Issue #19 · qjebbs/vscode-plantuml
April 7, 2017 - When JAVA_TOOL_OPTIONS environment variable is defined plugins says that there is error in diagram. Steps to reproduce: (OS Windows 10) Define JAVA_TOOL_OPTIONS environment variable (mine is JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8 -Djava...
Author   qjebbs
🌐
SAP
help.sap.com › doc › 2266902b9dd846cc9272377a05e00ecf › 3.0.14 › en-US › 7c04f9bf70061014b50ce1f5252638d4.html
Preparing for Installation
Check for JAVA_TOOL_OPTIONS in both User Variables and System Variables panes of the Environment Variables dialog. Right-click My Computer and select Properties. Select Advanced System Settings. Click the Advanced tab. Click Environment Variables.
Find elsewhere
🌐
DUG Insight
help.dugeo.com › m › faq › l › 98932-how-do-i-edit-the-java-s-overriding-environment-variable
How do I edit the Java's overriding Environment Variable? | Frequently Asked Questions | DUG Insight User Manual
In the Advanced tab in the System Properties window, click Environment Variables. This will open the Environment Variables window. In either the System variables or the User variables section, look for the "_JAVA_OPTIONS" variable.
🌐
YouTube
youtube.com › tech easy
how to set environment variables for java windows 10 - YouTube
when java is installed in computer,we need to set environment variables in our computer for Java to work,let us see how to set environment variables for java...
Published   November 3, 2017
Views   4K
🌐
Delft Stack
delftstack.com › home › howto › java › _java_options
_JAVA_OPTIONS Environment Variable in Java | Delft Stack
October 18, 2023 - Options set in JAVA_TOOL_OPTIONS only apply when running these JDK tools. _JAVA_OPTIONS: This environment variable affects all Java applications, not just JDK tools.
🌐
Java Code Geeks
javacodegeeks.com › home
JDK_JAVA_OPTIONS vs JAVA_TOOL_OPTIONS - Java Code Geeks
March 19, 2025 - Line 9: NOTE: Picked up JDK_JAVA_OPTIONS: "-Xms1g" . It prints out the JVM options defined by the JDK_JAVA_OPTIONS environment variable. Line 10: print out the JDK version: 17.
🌐
DEV Community
dev.to › sunnybhambhani › different-environment-variables-available-in-java-101o
Different environment variables available in Java - DEV Community
January 3, 2026 - Instead, various scripts that wrap the start-up of Java will often use an environment variable named JAVA_OPTS to configure the java executable (for example, the tomcat startup script does this). Ref: https://community.oracle.com/tech/developers/discussion/1542017/cannot-get-java-opts-to-work for more details. JAVA_TOOL_OPTIONS: >In some scenarios, the CLI is not accessible, like in mine, wherein we cannot pass the intended properties.
🌐
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 - It’s important to note that we set the environment variable and executed the java command on the same line, separated by a space. This ensures that JDK_JAVA_OPTIONS is only set for that specific java command. If we check the variable after running the command, we’ll see that JDK_JAVA_OPTIONS no longer holds a value: ... $ JAVA_TOOL_OPTIONS="-Dvar1='Hi (JAVA_TOOL_OPTIONS)' -Dvar2='There (JAVA_TOOL_OPTIONS)'" java com.baeldung.TestEnvVar Picked up JAVA_TOOL_OPTIONS: -Dvar1='Hi (JAVA_TOOL_OPTIONS)' -Dvar2='There (JAVA_TOOL_OPTIONS)' var1 = 'Hi (JAVA_TOOL_OPTIONS)' var2 = 'There (JAVA_TOOL_OPTIONS)'
🌐
Micro Focus
admhelp.microfocus.com › uft › en › 2021-2023 › UFT_Help › Content › Addins_Guide › Checking_Java_EnvironmentVariables_Settings.htm
Java environment variables - ADM Help Centers - Micro Focus
April 10, 2023 - Create a new environment variable called OPENJ9_JAVA_OPTIONS and set it to -Xshareclasses:enableBCI. The above settings should appear on one line (no newline separators). Note: Generally, these variable values are set automatically by UFT One, ...
🌐
Oracle
java.com › en › download › help › path.html
How do I set or change the PATH system variable?
In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK. Reopen Command prompt window, and run your java code. To run a different version of Java, either specify the full path, or use the java_home tool:
🌐
Oracle
docs.oracle.com › en › java › javase › 11 › troubleshoot › environment-variables-and-system-properties.html
C Environment Variables and System Properties
October 20, 2025 - Submit a Bug Report contains information on collecting environment variables in Environment Variables. ... In many environments, the command line is not readily accessible to start the application with the necessary command-line options. This often happens with applications that use embedded VMs (meaning they use the Java Native Interface (JNI) Invocation API to start the VM), or where the startup is deeply nested in scripts. In these environments the JAVA_TOOL_OPTIONS environment variable can be useful to augment a command line.
🌐
CodeJava
codejava.net › java-core › how-to-set-environment-variables-for-java-using-command-line
How to set environment variables for Java using command line
April 9, 2020 - Just go to Control Panel > System > Advanced system settings > Advanced > Environment Variables. You can see the whole steps to setup this stuff in the following article:How to write, compile and run a hello world Java program for beginners · But that isn’t cool, because I’m about to show ...