【发布时间】:2021-06-18 03:17:52
【问题描述】:
我正在使用 IDEA 来完成一些关于 JSF 的任务。 我只是用 glassfish 运行一个简单的项目,输出是这样的:
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/glassfish/admin/cli/AsadminMain has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)
google了一下,知道版本52就是jdk 8,所以我把其他的jdk都删了,只留下jdk8,版本确实是1.8:
C:\Users\42173>java -version
java version "1.8.0_291"
Java(TM) SE Runtime Environment (build 1.8.0_291-b10)
Java HotSpot(TM) 64-Bit Server VM (build 25.291-b10, mixed mode)
C:\Users\42173>javac -version
javac 1.8.0_291
但是还是报同样的错误,不知道怎么办。
并且我已经尝试过glassfish5,但输出仍然有错误:
[2021-06-18 11:14:13,323] Artifact untitled1:war exploded: Artifact is being deployed, please wait...
[2021-06-18 11:14:13,818] Artifact untitled1:war exploded: Error during artifact deployment. See server log for details.
[2021-06-18 11:14:13,818] Artifact untitled1:war exploded: java.io.IOException: com.sun.enterprise.admin.remote.RemoteFailureException: Error occurred during deployment: Exception while deploying the app [untitled1_war_exploded] : A MultiException has 4 exceptions. They are:
1. java.lang.IllegalAccessError: tried to access class sun.security.provider.SunEntries from class com.sun.crypto.provider.SunJCE
2. java.lang.IllegalStateException: Unable to perform operation: post construct on com.sun.enterprise.security.ssl.SSLUtils
3. java.lang.IllegalArgumentException: While attempting to resolve the dependencies of com.sun.enterprise.security.SecurityLifecycle errors were found
4. java.lang.IllegalStateException: Unable to perform operation: resolve on com.sun.enterprise.security.SecurityLifecycle
. Please see server.log for more details.
【问题讨论】:
标签: java intellij-idea server glassfish