When I turned Android Studio on Windows 10, I got this warning:
The use of Java options environment variables detected. Such variables override IDE configuration files (*.vmoptions) and may cause performance and stability issues. Please consider deleting these variables: JAVA_TOOL_OPTIONS.
So, I want to delete this variable, but I don't know how. This similar query didn't help me because I don't see this variable in system variables. I suspect I must have set it via the command line when I was troubleshooting another issue. When starting the console of any IDE, the message:
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF8
Is also displayed. Can it be deleted somehow?
As mentioned in the other questions, you get that warning if starting any
javaprocess when theJAVA_TOOL_OPTIONSenvironment variable is declared. This is mentioned in Windows Android Studio logs on start-up, and also if you runjava -versionfrom a terminal / cmd.exe.Before removing first check whether you need these addition settings or not. The setting
-Dfile.encoding=UTF8is 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:
Settings > System > About > Advanced System Settings -> Environment Variables:
Delete
JAVA_TOOL_OPTIONSvalues 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.
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) callingset JAVA_TOOL_OPTIONS=blahand 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):
Note:
setx VARNAME NEWVALUEdoes not need "=" sign.set VARNAME=NEWVALUErequires the "=" sign