java JAVA_OPTS 和 JAVA_TOOL_OPTIONS 的区别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3933300/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 04:00:52  来源:igfitidea点击:

Difference between JAVA_OPTS and JAVA_TOOL_OPTIONS?

java

提问by Daniel Perez Alvarez

When should each of these environment variables be used?

什么时候应该使用这些环境变量中的每一个?

采纳答案by Martijn Verburg

see "what is" docand "tool options" doc

请参阅“什么是”文档“工具选项”文档

Basically, the JAVA_TOOL_OPTIONSis intended for use by development tools, monitoring tools and the like whereas JAVA_OPTSis used for running 'general' Java programs, I think people tend to mix and match somewhat (from what Google has shown me example wise).

基本上,JAVA_TOOL_OPTIONS它旨在供开发工具、监控工具等JAVA_OPTS使用,而用于运行“通用”Java 程序,我认为人们倾向于混合和匹配(从 Google 向我展示的示例明智)。

回答by Stu Btwotwo

JAVA_TOOL_OPTIONSis read by some JDK tools, but has limited applicability.

JAVA_TOOL_OPTIONS被一些JDK工具读取,但适用性有限。

JAVA_OPTSis a convention used by Apache Tomcat and some other apps, but is not read directly by any JDK tools published by Sun/Oracle, AFAIK.

JAVA_OPTS是 Apache Tomcat 和其他一些应用程序使用的约定,但不能由 Sun/Oracle、AFAIK 发布的任何 JDK 工具直接读取。

From: https://forums.oracle.com/forums/thread.jspa?messageID=6438415

来自:https: //forums.oracle.com/forums/thread.jspa?messageID=6438415

JAVA_OPTS is not an environment variable that the java executable will recognize on it's own. Instead, various scripts which wrap the start up of java will often use an environment variable named JAVA_OPTS to configure the java executable (for example, the tomcat startup script does this).

JAVA_OPTS 不是 java 可执行文件将自行识别的环境变量。相反,包装 java 启动的各种脚本通常会使用名为 JAVA_OPTS 的环境变量来配置 java 可执行文件(例如,tomcat 启动脚本就是这样做的)。