Skip to content

Instantly share code, notes, and snippets.

@dirkraft
Last active October 13, 2015 02:58
Show Gist options
  • Save dirkraft/4128746 to your computer and use it in GitHub Desktop.
Save dirkraft/4128746 to your computer and use it in GitHub Desktop.
Java PID equivalent test, since there's really no guarantee in any direction (exception, format, ...) what this might do. Used this on an ec2 instance to make sure some metrics code wouldn't explode with OpenJDK.
echo "Does my jvm output something reasonable for a PID equivalent?"
echo "public class Main{public static void main(String[]args){System.out.println(java.lang.management.ManagementFactory.getRuntimeMXBean().getName());}}" > Main.java
javac Main.java
java Main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment