Thursday, February 16, 2017

java cmd cheatsheet

1. List files in a jar package:
 $ jar tvf my.jar

2. Extract files out of a jar package:
 $ jar xvf my.jar

3. Package current directory with Manifest file:
 $ jar cvfm my.jar META-INF/MANIFEST.MF ./

 4. javap is like nm in *NIX

5. jps like ps in *NIX
    jps -lvm

6. Print flags of a JVM process
    jinfo -flags

7. jconsole, other than jps/jinfo commands you can use jconsole to monitor a JVM process. It provides lots of information you need to tune your process.

8. jvisualvm, similar as jconsole

9. jstack, print process stack information

No comments: