Error: A JNI error has occurred, please check your installation and try again

Posted 柳鲲鹏

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Error: A JNI error has occurred, please check your installation and try again相关的知识,希望对你有一定的参考价值。

  今天加了一下优化选项,测试ProGuard。然后出现了错误。一想,同事刚加了个几个包,是不是因为这个?复制过来之后,依然出错:

C:\\Program Files\\Taishan\\Office\\bin>..\\jdk\\bin\\java -jar Office.jar
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.VerifyError: Expecting a stackmap frame at branch target 60
Exception Details:
  Location:
    Main.x()I @5: ifnull
  Reason:
    Expected stackmap frame at this location.
  Bytecode:
    0x0000000: b802 bb59 4bc6 0037 2ab4 0105 593b 049f
    0x0000010: 0013 1a06 9f00 0e1a 089f 0009 1a10 07a0
    0x0000020: 001d b201 1604 7e9a 0015 04b3 0116 06bc
    0x0000030: 0a59 0304 4f59 0508 4fb3 012b b201 16ac
    0x0000040:

        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)

  奇怪的是,使用另外一种方式就能启动。网上搜索:

  • 一种可能是编译与运行使用的JDK不一致。这个不存在。吾都是泰山JDK8。
  • 需要加个-noverify
C:\\Program Files\\Taishan\\Office\\bin>..\\jdk\\bin\\java -jar -noverify Office.jar

  果然正常了。再去棵棵另外一种启动方式,原来有类似参数。这样就通顺了。

以上是关于Error: A JNI error has occurred, please check your installation and try again的主要内容,如果未能解决你的问题,请参考以下文章

Error: A JNI error has occurred, please check your installation and try again

Error: A JNI error has occurred, please check your installation and try again

Error: A JNI error has occurred, please check your installation and try again

Error: A JNI error has occurred, please check your installation and try again

使用java命令出现Error: A JNI error has occurred, please check your installation and try again的错误

Error: A JNI error has occurred, please check your installation and try again的全面解决方法