gpt4 book ai didi

java - 代号 "AWT-EventQueue-0"java.lang.UnsupportedClassVersionError : javafx/scene/media/MediaException has been compiled by a more recent version

转载 作者:行者123 更新时间:2023-12-02 09:13:03 25 4
gpt4 key购买 nike

我正在创建一个新的 Codenameone 项目,当我尝试运行它时,它会抛出以下错误:

java.net.URISyntaxException: Illegal character in path at index 27: file:/Applications/IntelliJ IDEA.app/Contents/lib/idea_rt.jar
at java.net.URI$Parser.fail(URI.java:2848)
at java.net.URI$Parser.checkChars(URI.java:3021)
at java.net.URI$Parser.parseHierarchical(URI.java:3105)
at java.net.URI$Parser.parse(URI.java:3053)
at java.net.URI.<init>(URI.java:588)
at java.net.URL.toURI(URL.java:953)
at com.codename1.impl.javase.JavaFXLoader.addToClassPath(JavaFXLoader.java:296)
at com.codename1.impl.javase.JavaFXLoader.addJavaFXToClassPath(JavaFXLoader.java:221)
at com.codename1.impl.javase.JavaFXLoader.runWithJavaFX(JavaFXLoader.java:244)
at com.codename1.impl.javase.JavaFXLoader.main(JavaFXLoader.java:323)
at com.codename1.impl.javase.Executor.main(Executor.java:113)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.codename1.impl.javase.Simulator.main(Simulator.java:85)
Exception in thread "AWT-EventQueue-0" java.lang.UnsupportedClassVersionError: javafx/scene/media/MediaException has been compiled by a more recent version of the Java Runtime (class file version 54.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(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:489)
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 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)

我还注意到theme.res知道我在这里缺少什么吗?

最佳答案

故事:

这是创建项目时的一个愚蠢错误(不是那么错误,而是缺乏信息)。我不确定是否可以轻松修复项目而不重新创建它(我尝试从 IntelliJ 中的项目结构以及 build.xml 更改 Java 版本,但没有成功),但如果您要创建一个新项目,请创建使用 java 版本 11 的项目(因为我不确定它是否适用于更高版本)。

原因是代号是用比我最初在新项目窗口中选择的版本更高的 Java 版本编译的。

解决方案:

在创建新的 Codenameone 项目时选择 java_version 11

enter image description here

关于java - 代号 "AWT-EventQueue-0"java.lang.UnsupportedClassVersionError : javafx/scene/media/MediaException has been compiled by a more recent version,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59242322/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com