I am trying to add JMX auth in windows environment. I am referring : http://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html
我想在Windows环境中添加JMX auth。我指的是:http://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html
My usecase is that there are 100 odd desktop clients which we distribute via jar's. I want to package jmxaccess and jmxpassword file along with it. However my initial impression is (according to oracle doc) that i need to set up the password file in the JRE_HOME/lib/management directory. This will be very tedious to do for each user. Can someone please help me understand if we can provide custom paths in windows env. (similar to unix)?
我的用例是有100个奇怪的桌面客户端,我们通过jar分发。我想打包jmxaccess和jmxpassword文件。但是我最初的印象是(根据oracle doc)我需要在JRE_HOME / lib / management目录中设置密码文件。这对每个用户来说都非常繁琐。有人可以帮我理解我们是否可以在windows环境中提供自定义路径。 (类似于unix)?
Thank you.
1 个解决方案
#1
Of course, the JRE_HOME.. path is the default. You can use a CMD option like
当然,JRE_HOME ..路径是默认路径。您可以使用CMD选项
java -Dcom.sun.management.jmxremote.password.file=/location/to/my/file
-Dcom.sun.management.jmxremote.access.file=/location/to/my/file -jar ...
com.sun.management.jmxremote.password.file: Specifies location for password file. If com.sun.management.jmxremote.authenticate is false, then this property and the password and access files are ignored. Otherwise, the password file must exist and be in the valid format. If the password file is empty or nonexistent, then no access is allowed.
com.sun.management.jmxremote.password.file:指定密码文件的位置。如果com.sun.management.jmxremote.authenticate为false,则忽略此属性以及密码和访问文件。否则,密码文件必须存在且格式有效。如果密码文件为空或不存在,则不允许访问。
com.sun.management.jmxremote.access.file: Specifies location for the access file. If com.sun.management.jmxremote.authenticate is false, then this property and the password and access files are ignored. Otherwise, the access file must exist and be in the valid format. If the access file is empty or nonexistent, then no access is allowed. Source: http://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html#gdevf
com.sun.management.jmxremote.access.file:指定访问文件的位置。如果com.sun.management.jmxremote.authenticate为false,则忽略此属性以及密码和访问文件。否则,访问文件必须存在且格式有效。如果访问文件为空或不存在,则不允许访问。资料来源:http://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html#gdevf
#1
Of course, the JRE_HOME.. path is the default. You can use a CMD option like
当然,JRE_HOME ..路径是默认路径。您可以使用CMD选项
java -Dcom.sun.management.jmxremote.password.file=/location/to/my/file
-Dcom.sun.management.jmxremote.access.file=/location/to/my/file -jar ...
com.sun.management.jmxremote.password.file: Specifies location for password file. If com.sun.management.jmxremote.authenticate is false, then this property and the password and access files are ignored. Otherwise, the password file must exist and be in the valid format. If the password file is empty or nonexistent, then no access is allowed.
com.sun.management.jmxremote.password.file:指定密码文件的位置。如果com.sun.management.jmxremote.authenticate为false,则忽略此属性以及密码和访问文件。否则,密码文件必须存在且格式有效。如果密码文件为空或不存在,则不允许访问。
com.sun.management.jmxremote.access.file: Specifies location for the access file. If com.sun.management.jmxremote.authenticate is false, then this property and the password and access files are ignored. Otherwise, the access file must exist and be in the valid format. If the access file is empty or nonexistent, then no access is allowed. Source: http://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html#gdevf
com.sun.management.jmxremote.access.file:指定访问文件的位置。如果com.sun.management.jmxremote.authenticate为false,则忽略此属性以及密码和访问文件。否则,访问文件必须存在且格式有效。如果访问文件为空或不存在,则不允许访问。资料来源:http://docs.oracle.com/javase/8/docs/technotes/guides/management/agent.html#gdevf