在Idea打开gradle应用程序时抛出异常

时间:2016-10-30 06:07:40

标签: java intellij-idea gradle

我是gradle的新手,当我用gradle打开idea个应用时,它会抛出错误Gradle 3.1 requires Java 7 or later to run. Your build is currently configured to use Java 6

我的gradle信息:

Gradle 3.1

建造时间:2016-09-19 10:53:53 UTC

修订版:13f38ba699afd86d7cdc4ed8fd7dd3960c0b1f97

Groovy:2.4.7

Ant:2015年6月29日编译的Apache Ant(TM)版本1.9.6

JVM:1.8.0_60(Oracle Corporation 25.60-b23)

操作系统:Mac OS X 10.11.6 x86_64

主意

enter image description here

错误

enter image description here

构思设置

file - >其他设置 - >默认项目设置

enter image description here

EIDT

日志

2016-10-30 14:25:06,941 [1651420]   INFO - .BaseProjectImportErrorHandler - Failed to import Gradle project at '/Users/famoss/Downloads/btrace-master/gradle' 

org.gradle.tooling.GradleConnectionException: Could not create an instance of Tooling API implementation using the specified Gradle installation '/Users/famoss/Downloads/gradle-3.1'.

Caused by: org.gradle.internal.jvm.UnsupportedJavaRuntimeException: Gradle 3.1 requires Java 7 or later to run. You are currently using Java 6.

2 个答案:

答案 0 :(得分:3)

将构思版本更新为2016.2.5,问题解决了。

答案 1 :(得分:0)

检查local.properties文件以查看哪个版本的java gradle尝试引用。此文件应与gradle文件位于同一目录中。

通常在项目创建时自动配置此文件,但这取决于您的intellij设置。