Is there a better way to print system properties from command line? As we can set the property e.g.
java -D= //set a system property
You can use jps a tool that comes with the jdk. It can print out the system properties that were passed to a java process.
For example: On my system eclipse is running and
$ jps -v
outputs
6632 -Dosgi.requiredJavaVersion=1.6 -Xms1024m -Xmx2048m -XX:MaxPermSize=512m
jps
is located in JDK_HOME/bin
EDIT
If you want all the properties use the jinfo tool that is also located in JDK_HOME/bin
. To use it you must know the process id of the java process you want to get information from. E.g.
$ jinfo 6632
This tool also prints out the java.ext.dirs