1.下载Apache Maven 3.5.3
http://maven.apache.org/download.cgi
解压为C:maven3
在系统环境变量加入PATH后加入maven3的bin目录C:maven3in
C:UsersAdministrator>mvn -version Apache Maven 3.5.3 (3383c37e1f9e9b3bc3df5050c29c8aff9f295297; 2018-02-25T03:49:05+08:00) Maven home: C:maven3in.. Java version: 1.8.0_161, vendor: Oracle Corporation Java home: C:Program FilesJavajdk1.8.0_161jre Default locale: zh_CN, platform encoding: GBK OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"
2.下载hsdis
https://download.csdn.net/download/y1250056491/10102978
复制文件windows下的HotSpot虚拟机JIT编译代码的反汇编插件,有32位和64位两个版本,放在类似jre1.8.0_141inserver和jdk1.8.0_1414jreinserver目录下即可
或者
https://files.cnblogs.com/files/zengkefu/hsdis.rar
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