开发者

Java code to check for JVM options

开发者 https://www.devze.com 2023-02-12 18:40 出处:网络
Can any one help me with some referenes as to how I can check different values passed to the JVM. For 开发者_JAVA技巧example if I invoke the jvm with the following options \"-Djava.library.path=lib\",

Can any one help me with some referenes as to how I can check different values passed to the JVM. For 开发者_JAVA技巧example if I invoke the jvm with the following options "-Djava.library.path=lib", how do I check what is passed as library arguments to the JVM.


The things set by the -D flag are called sytem properties. You can retrieve them using System.getProperty. eg:

System.getProperty("java.library.path")

There are a few other methods in System that may be of interest you you, like System.getProperties which returns the entire set of system properties.

Note that there are some system properties that will have values even without being set by the -D flag.

0

精彩评论

暂无评论...
验证码 换一张
取 消