简体   繁体   English

在Windows上全局设置“JAVA_OPTS”

[英]Setting “JAVA_OPTS” globally on Windows

I need to set -Dfile.encoding=UTF8 globally on Windows machine. 我需要在Windows机器上全局设置-Dfile.encoding = UTF8。
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. 我试图在My Computer -> Properties ->Environment Variables设置JAVA_OPTS环境变量,也通过Control Panel->Java->Java Runtime Environment Settings但这些都没有效果。
How can I set JAVA_OPTS (and specially file.encoding property) globally in windows? 如何在Windows中全局设置JAVA_OPTS(特别是file.encoding属性)?

Thanks 谢谢

Did you try setting up environment variable JAVA_TOOL_OPTIONS ? 您是否尝试过设置环境变量JAVA_TOOL_OPTIONS

Set this to "-Dfile.encoding=UTF8" and it is supposed to be picked up by jvm. 将其设置为"-Dfile.encoding=UTF8" ,它应该被jvm选中。 But if it doesn't, you are left with no choice other than to use command line parameter. 但如果没有,除了使用命令行参数之外别无选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM