1、新建文档jstatd.all.policy,并将文档放在/usr/local/jdk1.8.0_45/bin
grant codebase "file:${java.home}/../lib/tools.jar" {
permission java.security.AllPermission;
};
2、运行nohup $JAVA_HOME/bin/jstatd -J-Djava.security.policy=jstatd.all.policy &
[root@test-chat234 ~]# cd /usr/local/jdk1.8.0_45/bin
[root@test-chat234 bin]# nohup $JAVA_HOME/bin/jstatd -J-Djava.security.policy=jstatd.all.policy &
[1] 5804
3、查看hostname -i得到该机器的IP
[root@test-chat234 bin]# hostname -i
192.168.9.234
4、在java visualvm的远程中添加192.168.9.234
执行Profiler时报错:
Redefinition failed with error 62 Check JVMTI documentation for this error code.
在JVM运行参数中加上:-Xverify:none