简体   繁体   中英

Throw an exception when open a gradle application by Idea

I'm a newer to gradle ,and when i open a gradle application with idea ,Then it throw an error Gradle 3.1 requires Java 7 or later to run. Your build is currently configured to use Java 6 Gradle 3.1 requires Java 7 or later to run. Your build is currently configured to use Java 6 .

My gradle info:


Gradle 3.1

Build time: 2016-09-19 10:53:53 UTC

Revision: 13f38ba699afd86d7cdc4ed8fd7dd3960c0b1f97

Groovy: 2.4.7

Ant: Apache Ant(TM) version 1.9.6 compiled on June 29 2015

JVM: 1.8.0_60 (Oracle Corporation 25.60-b23)

OS: Mac OS X 10.11.6 x86_64


idea

在此处输入图片说明

error

在此处输入图片说明

idea setting

file -> other settings -> default project setting

在此处输入图片说明

EIDT

Log

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.

将想法版本更新为2016.2.5 ,问题已解决。

Check your local.properties file to see which version of java gradle is trying to reference. This file should be in the same directory as your gradle file.

Typically this file is automatically configured on project creation, but it depends on your intellij settings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM