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.
精彩评论