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
If you need defaults that your JVM will initially have set unless overridden, use:
java -XshowSettings:properties -version
This is helpful if you don't have a Java application already running, thus no pid to pass to one of the other commands.
If you are seeking the properties of a JVM already running that has properties set via default or set explicitly by command, then use the pid for that JVM found via jps
with the jcmd
or jinfo
commands as listed in answers above.