我刚刚安装了ubuntu 18.04,但我无法运行codenameone程序 这是堆栈跟踪
线程“ AWT-EventQueue-1”中的异常java.lang.UnsupportedClassVersionError:Javafx / embed / swing / JFXPanel已由Java Runtime的最新版本(类文件版本54.0)进行编译。 Java Runtime只能识别
class file versions up to 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:468)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at com.codename1.impl.javase.JavaFXLoader$1.loadClass(JavaFXLoader.java:307)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at com.codename1.impl.ImplementationFactory.createImplementation(ImplementationFactory.java:69)
at com.codename1.ui.Display.init(Display.java:484)
at com.codename1.impl.javase.Executor$3.run(Executor.java:245)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at org.GNOME.Accessibility.AtkWrapper$6.dispatchEvent(AtkWrapper.java:715)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
BUILD STOPPED (total time: 7 seconds)
答案 0 :(得分:1)
请确保您使用的是带有JavaFX的JDK 8(例如Zulu或Oracle JDK)或JDK11。JDK中的JavaFX支持是为较新的VM编译的,而对于JDK 9/10则失败了。