How do I use the JAVA_OPTS environment variable?(如何使用 JAVA_OPTS 环境变量?)
问题描述
如何使用 JAVA_OPTS
变量来配置 Web 服务器(Linux 服务器)?
How do I use the JAVA_OPTS
variable to configure a web server (a linux server)?
如何使用 JAVA_OPTS
设置 -Djava.awt.headless=true
?
推荐答案
JAVA_OPTS
是一些服务器和其他 java 应用程序附加到执行 java
的调用的标准环境变量代码>命令.
JAVA_OPTS
is the standard environment variable that some servers and other java apps append to the call that executes the java
command.
例如在tomcat中定义JAVA_OPTS='-Xmx1024m'
,启动脚本会执行java org.apache.tomcat.Servert -Xmx1024m
For example in tomcat if you define JAVA_OPTS='-Xmx1024m'
, the startup script will execute java org.apache.tomcat.Servert -Xmx1024m
如果你是在 Linux/OSX 上运行,你可以在调用启动脚本之前设置 JAVA_OPTS
If you are running in Linux/OSX, you can set the JAVA_OPTS, right before you call the startup script by doing
JAVA_OPTS='-Djava.awt.headless=true'
这只会在控制台打开时持续.要使其更永久,您可以将其添加到您的 ~/.profile 或 ~/.bashrc 文件中.
This will only last as long as the console is open. To make it more permanent you can add it to your ~/.profile or ~/.bashrc file.
这篇关于如何使用 JAVA_OPTS 环境变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何使用 JAVA_OPTS 环境变量?


基础教程推荐
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 大摇大摆的枚举 2022-01-01
- 从 python 访问 JVM 2022-01-01
- 多个组件的复杂布局 2022-01-01
- Java Swing计时器未清除 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01