Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting "JAVA_OPTS" globally on Windows

I need to set -Dfile.encoding=UTF8 globally on Windows machine.
I tried to set JAVA_OPTS environment variable in My Computer -> Properties ->Environment Variables and also via Control Panel->Java->Java Runtime Environment Settings but these had no effect.
How can I set JAVA_OPTS (and specially file.encoding property) globally in windows?

Thanks

like image 325
Ariyan Avatar asked Mar 23 '12 15:03

Ariyan


People also ask

How do I set Java options in Windows?

Windows 10Right-click on the Start button and select the Control Panel option. In the Windows Control Panel, click on Programs. Click on the Java icon to open the Java Control Panel.

What is JAVA_OPTS environment variable?

JAVA_OPTS is an environment variable that you can set to pass custom settings to the Java Virtual Machine (JVM) that runs Liquibase.

What is the difference between JAVA_OPTS and Catalina_opts?

Use CATALINA_OPTS rather than JAVA_OPTS since CATALINA_OPTS is only used on start whereas JAVA_OPTS is used on start and stop.


1 Answers

Did you try setting up environment variable JAVA_TOOL_OPTIONS ?

Set this to "-Dfile.encoding=UTF8" and it is supposed to be picked up by jvm. But if it doesn't, you are left with no choice other than to use command line parameter.

like image 52
ring bearer Avatar answered Sep 27 '22 17:09

ring bearer