使用arthas-boot报CurrentVM java version: 11 do not match target VM java version: 1.8, attach may fail

运行arthas-boot后,连接tomcat后报Current VM java version: 11 do not match target VM java version: 1.8, attach may fail

ccc@cccdeMacBook-Pro 01-arthas-packaging-3.5.0-bin % java -jar arthas-boot.jar
[INFO] arthas-boot version: 3.5.0
[INFO] Found existing java process, please choose one and input the serial number of the process, eg : 1. Then hit ENTER.
* [1]: 22224 org.springframework.ide.vscode.boot.app.BootLanguagServerBootApp
  [2]: 22496
  [3]: 22211
  [4]: 37337 org.apache.catalina.startup.Bootstrap
  [5]: 31006 myssh.App
4
[INFO] arthas home: /Users/chyzhong/01-worktools/17-Ali-production/01-arthas-packaging-3.5.0-bin
[INFO] Try to attach process 37337
[WARN] Current VM java version: 11 do not match target VM java version: 1.8, attach may fail.
[WARN] Target VM JAVA_HOME is /Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/jre, arthas-boot JAVA_HOME is /Library/Java/JavaVirtualMachines/jdk-11.0.9.jdk/Contents/Home, try to set the same JAVA_HOME.
[ERROR] Start arthas failed, exception stack trace:
com.sun.tools.attach.AgentLoadException: 0
	at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(HotSpotVirtualMachine.java:108)
	at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgentLibrary(HotSpotVirtualMachine.java:119)
	at jdk.attach/sun.tools.attach.HotSpotVirtualMachine.loadAgent(HotSpotVirtualMachine.java:147)
	at com.taobao.arthas.core.Arthas.attachAgent(Arthas.java:118)
	at com.taobao.arthas.core.Arthas.<init>(Arthas.java:26)
	at com.taobao.arthas.core.Arthas.main(Arthas.java:137)
[ERROR] attach fail, targetPid: 37337

原因: arthas-boot使用jdk11,tomcat使用jdk8,不同的jvm环境。

解决办法,指定jdk8来运行arthas-boot:

/Library/Java/JavaVirtualMachines/jdk1.8.0_261.jdk/Contents/Home/bin/java -jar arthas-boot.jar
  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值