开发者

Java code to check for JVM options

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜