如果您有任何正在运行的 java 应用程序 'jinfo' 是您的朋友:
Usage:
jinfo [option] <pid>
(to connect to running process)
jinfo [option] <executable <core>
(to connect to a core file)
jinfo [option] [server_id@]<remote server IP or hostname>
(to connect to remote debug server)
where <option> is one of:
-flag <name> to print the value of the named VM flag
-flag [+|-]<name> to enable or disable the named VM flag
-flag <name>=<value> to set the named VM flag to the given value
-flags to print VM flags
-sysprops to print Java system properties
<no option> to print both of the above
-h | -help to print this help message
所以
jinfo -sysprops <pid of javaprocess> | grep "java.vendor = "
给你系统属性。
当心:
另请注意,系统属性的值可以被覆盖!例如,如果 myProperties.txt 包含以下行,则 java.vendor 系统属性将被覆盖:
java.vendor=Acme 软件公司