设置“JAVA_OPTS”全球在Windows上 [英] Setting "JAVA_OPTS" globally on Windows

查看:779
本文介绍了设置“JAVA_OPTS”全球在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆