我能够正确运行我的intelliJ,但是当我尝试导入我的gradle项目时,它会显示以下消息:
Gradle 3.5 requires Java 7 or later to run.You are currently using Java 6.
问题是,如果我运行java -version,我得到这个:
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode)
gradle -version我得到了这个:
------------------------------------------------------------
Gradle 4.0
------------------------------------------------------------
Build time: 2017-06-14 15:11:08 UTC
Revision: 316546a5fcb4e2dfe1d6aa0b73a4e09e8cecb5a5
Groovy: 2.4.11
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.10.2 x86_64
如果我尝试从命令行运行IntelliJ,我可以在我的控制台上看到:
[ 5891] ERROR - #com.intellij.lang.Language - IntelliJ IDEA 14.1.4 Build #IU-141.1532.4
[ 5891] ERROR - #com.intellij.lang.Language - JDK: 1.6.0_65
[ 5891] ERROR - #com.intellij.lang.Language - VM: Java HotSpot(TM) 64-Bit Server VM
[ 5891] ERROR - #com.intellij.lang.Language - Vendor: Apple Inc.
[ 5891] ERROR - #com.intellij.lang.Language - OS: Mac OS X
如何修改运行IntelliJ的JDK? 如果我在导入项目时尝试设置jdk和gradle,我仍然会遇到同样的错误。
谢谢!