Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arthas启动失败 报 A JNI error has occurred, please check your installation and try again #2809

Open
1 task done
user112user opened this issue Mar 15, 2024 · 0 comments

Comments

@user112user
Copy link

user112user commented Mar 15, 2024

  • 我已经在 issues 里搜索,没有重复的issue。

环境信息

  • arthas-boot.jar 或者 as.sh 的版本: 3.7.2
  • Arthas 版本: 3.7.2
  • 操作系统版本: Windows10
  • 目标进程的JVM版本: xxx
  • 执行arthas-boot的版本: 3.7.2

重现问题的步骤

  1. 创建目录 cmd 启动idea curl -O https://arthas.aliyun.com/arthas-boot.jar java -jar arthas-boot.jar
  2. 报错

期望的结果

正常启动

实际运行的结果

报错

把异常信息贴到这里

E:\installment>java -jar arthas-boot.jar
[INFO] JAVA_HOME: E:\Idea_JDK\jdk11
[INFO] arthas-boot version: 3.7.2
[INFO] Found existing java process, please choose one and input the serial number of the process, eg : 1. Then hit ENTER.

  • [1]: 4500 math-game.jar
    [2]: 1112
    1
    [INFO] Start download arthas from remote server: https://arthas.aliyun.com/download/3.7.2?mirror=aliyun
    [INFO] File size: 17.84 MB, downloaded size: 13.21 MB, downloading ...
    [INFO] Download arthas success.
    [INFO] arthas home: C:\Users\Admin.arthas\lib\3.7.2\arthas
    [INFO] Try to attach process 4500
    Error: A JNI error has occurred, please check your installation and try again
    Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/tools/attach/AgentLoadException
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
    at java.lang.Class.getMethod0(Class.java:3018)
    at java.lang.Class.getMethod(Class.java:1784)
    at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:650)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:632)
    Caused by: java.lang.ClassNotFoundException: com.sun.tools.attach.AgentLoadException
    at java.net.URLClassLoader.findClass(URLClassLoader.java:387)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
    ... 7 more
    [ERROR] attach fail, targetPid: 4500

备注:java的版本和javac的版本一致
E:\installment>java -version
java version "11.0.13" 2021-10-19 LTS
Java(TM) SE Runtime Environment 18.9 (build 11.0.13+10-LTS-370)
Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.13+10-LTS-370, mixed mode)

E:\installment>javac -version
javac 11.0.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant