如何在Eclipse Mars中导入Gradle / Java8项目(不支持的类版本错误)?

时间:2015-10-09 15:55:11

标签: java eclipse gradle java-8

我想将Java8项目导入我的工作区。当我导入它们时,我收到以下错误消息:

Loading Gradle project preview failed due to an error in the referenced Gradle build.
Could not fetch model of type 'GradleBuild' using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.8-rc-1-bin.zip'.

Build file '/home/PROJECT/git/PROJECT/libraries/build.gradle' line: 1
A problem occurred evaluating root project 'libraries'.
java.lang.UnsupportedClassVersionError: com/PROJECT/gradle/versioning/VersioningPlugin : Unsupported major.minor version 52.0
com/PROJECT/gradle/versioning/VersioningPlugin : Unsupported major.minor version 52.0

我将Java合规性级别设置为1.8

enter image description here

但我仍然得到这个错误。我安装的Java版本是(java -version):

openjdk version "1.8.0_45-internal"
OpenJDK Runtime Environment (build 1.8.0_45-internal-b14)
OpenJDK 64-Bit Server VM (build 25.45-b02, mixed mode)

在我看来,一切都应该如此,......那又怎么了?

编辑:

我的执行环境有Java8-Version:

enter image description here

所有构建路径变量都指向Java8:

enter image description here

1 个答案:

答案 0 :(得分:0)

检查您是否在Project Properties>中运行Java 8 Java构建路径>标签库。还要检查您的运行配置(菜单运行>运行配置>标签设置>执行环境)