类文件有错误的版本 52.0,应该是 50.0 [英] Class file has wrong version 52.0, should be 50.0
问题描述
我正在尝试在 IntelliJ 创意中编译我的项目.我在外部 jar 文件中使用一个类,并且在编译时收到以下错误.
I'm trying to compile my project in IntelliJ idea. I'm using a class in an external jar file and on compilation receiving the following error.
Class file has wrong version 52.0, should be 50.0
我知道它是说 jar 文件是用比 IntelliJ 使用的 Java 版本更新的 Java 版本编译的.我的问题是如何使它们兼容?我已将 Mac 上的 Java 更新为 1.8,当我运行 java -version
或 javac -version
时,它确认了这一点.
I understand that it's saying the jar file was compiled with a newer Java version than that which IntelliJ is using. My question is how do I make them compatible? I have updated the Java on my Mac to 1.8 and when I run java -version
or javac -version
it confirms this.
我错过了什么?(Java 开发经验除外)
What am I missing? (Apart from Java development experience)
推荐答案
选择文件"->项目结构".
Select "File" -> "Project Structure".
在项目设置"下选择项目"
Under "Project Settings" select "Project"
从那里您可以选择项目 SDK".
From there you can select the "Project SDK".
这篇关于类文件有错误的版本 52.0,应该是 50.0的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!