英文:
Cannot access greenfoot.World - class file has wrong version
问题
我尝试在Mac上使用Intellij IDEA进行Greenfoot开发。
这里有一个使用NetBeans与Greenfoot的教程链接:
https://www.greenfoot.org/doc/running_on_netbeans
所以我在Greenfoot中创建了我的场景。然后保存它并在IDEA中打开。
我从应用程序包中获取了greenfoot.jar和bluejcore.jar,并将这些库添加到项目结构中。
在这一点上,我收到以下错误:
错误:(9, 30)java: 无法访问greenfoot.World 坏的类文件:
/Users/.../Greenfoot/greenfoot.jar!/greenfoot/World.class
类文件版本错误 55.0,应为52.0
请删除或确保它出现在类路径的正确子目录中。
某个版本冲突。然而,我从我的机器上安装的Greenfoot应用程序中获取了这两个JAR文件。感谢提供帮助。
英文:
I try to use Intellij IDEA for Greenfoot development on Mac.
Here is a tutorial to use NetBeans with Greenfoot:
https://www.greenfoot.org/doc/running_on_netbeans
So I created my scenario in Greenfoot. Then saved it and opened it in IDEA.
I took greenfoot.jar and bluejcore.jar from application package and added these libraries to a project structure.
At this point I receive the following error:
> Error:(9, 30) java: cannot access greenfoot.World bad class file:
> /Users/.../Greenfoot/greenfoot.jar!/greenfoot/World.class
> class file has wrong version 55.0, should be 52.0
> Please remove or make sure it appears in the correct subdirectory of the classpath.
Some conflict with a version. However I took both jars from the Greenfoot application installed on my machine. Appreciate some help.
答案1
得分: 2
错误表示 greenfoot.World
是用 Java 11 编译的,而您尝试使用支持 Java 8 的编译器来使用它。
英文:
The error says, that greenfoot.World
was compiled with Java 11 and you try to use it with a compiler supporting up to Java 8.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论