繁体   English   中英

可以在文件中写入命令属性

[英]Possible to write command properties in a file

我需要运行具有 JMX 功能的 Java 程序,因此命令类似于:

java -Dcom.sun.management.jmxremote.port=10200 -Dcom.sun.management.jmxremote.authenticate=true -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.password.file= jmxremote.password -Dcom.sun.management.jmxremote.access.file=jmxremote.access

这使得命令行太长,是否可以将属性写入文件中,以缩短命令? 或者任何其他解决方案将受到欢迎!

您可以使用包含所有 JMX 选项的属性文件 (management.properties),如下所示。

com.sun.management.jmxremote.port=10200
com.sun.management.jmxremote.authenticate=false
com.sun.management.jmxremote.ssl=false
....

但是您必须通过以下方式告诉 JVM 可使用 JMX 属性的位置

java -Dcom.sun.management.config.file=c:\\management.properties

暂无
暂无

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

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