1.下载Apache Maven 3.5.3
http://maven.apache.org/download.cgi
解压为C:\maven3
在系统环境变量加入PATH后加入maven3的bin目录C:\maven3\bin
C:\Users\Administrator>mvn -version
Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T03:49:05+08:00)
Maven home: C:\maven3\bin\..
Java version: 1.8.0_161, vendor: Oracle Corporation
Java home: C:\Program Files\Java\jdk1.8.0_161\jre
Default locale: zh_CN, platform encoding: GBK
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
2.下载hsdis
复制文件windows下的HotSpot虚拟机JIT编译代码的反汇编插件,有32位和64位两个版本,放在类似\jre1.8.0_141\bin\server和\jdk1.8.0_1414\jre\bin\server目录下即可
或者
3.下载jitwatch
https://github.com/AdoptOpenJDK/jitwatch
下载解压到c:\jitwatch
4.执行java程序
C:\java>java -server -XX:+UnlockDiagnosticVMOptions -XX:+TraceClassLoading -XX:+PrintAssembly -XX:+LogCompilation -XX:LogFile=java.log XX
如果使用jdk8,则编译器默认使用分层编译技术,需要关闭:-XX:-TieredCompilation 关闭分层编译
5.起动jitwatch
C:\jitwatch>mvn clean compile exec:java