我想将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:

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

但我仍然收到此错误。我安装的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版本:

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

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

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

最佳答案

在项目属性> Java构建路径>选项卡库中检查是否正在运行Java 8。还要检查您的运行配置(菜单运行>运行配置>选项卡设置>执行环境)

10-07 20:49