javatomcatsystem-properties

Get tomcat to spill system properties


I googled everything I could think of and couldn't find anything.

Does anyone know a way to get tomcat to dump the output of System.getProperties() of the current runtime environment? It would certainly be useful to have sometimes.


Solution

  • You can actually copy-paste the values if you use the java mission control tool:

    $JAVA_HOME/bin/jmc
    

    Start a JMX console against your Tomcat's JVM process, then look under the System tab. You can see all values and copy the values under System properties.

    enter image description here

    You may need to check the documentation on enabling remote JMX if you're going to do this from a remote machine.