设置“JAVA_OPTS”全球在Windows上 [英] Setting "JAVA_OPTS" globally on Windows
问题描述
我需要在Windows机器上全局设置-Dfile.encoding = UTF8。
我尝试在我的电脑中设置JAVA_OPTS环境变量 - >属性 - >环境变量
以及通过控制面板 - > Java-> Java运行时环境设置
但这些没有任何效果。 >
如何在Windows中全局设置JAVA_OPTS(特别是 file.encoding
属性)
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?
谢谢
推荐答案
您是否尝试设置环境变量 JAVA_TOOL_OPTIONS
?
Did you try setting up environment variable JAVA_TOOL_OPTIONS
?
将其设置为 - Dfile.encoding = UTF8
,它应该由jvm拾取。但是如果没有,除了使用命令行参数之外你别无选择。
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.
这篇关于设置“JAVA_OPTS”全球在Windows上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!