Gradle 3.3 错误需要 Java 7 或更高版本未解决
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43133857/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Gradle 3.3 Error Need Java 7 or Later Unsolved
提问by Temen Nyantai
i just imported some project that i bought from my friend. Once i import it to Android Studio 2.1.2 i just get this messages "Error:Gradle 3.3 requires Java 7 or later to run. You are currently using Java 6."
我刚刚导入了我从朋友那里购买的一些项目。一旦我将它导入到 Android Studio 2.1.2,我就会收到以下消息“错误:Gradle 3.3 需要 Java 7 或更高版本才能运行。您当前使用的是 Java 6。”
I have install Java 7 and 8 in my mac. I have change the directory in Default Project Structure, but still that messages always appear and i can't do anything with the code.
我已经在我的 mac 中安装了 Java 7 和 8。我已经更改了默认项目结构中的目录,但仍然总是出现该消息,并且我无法对代码执行任何操作。
Please master, help me.
请高手帮帮我。
回答by Ryan
Ran into the same issue, but I needed to keep java 6 for macOS legacy reasons (as I commented on Shubhendu's post). So I ended up downloading java 8 jdk found here
遇到了同样的问题,但由于 macOS 遗留原因,我需要保留 java 6(正如我在 Shubhendu 的帖子中评论的那样)。所以我最终下载了在这里找到的 java 8 jdk
and on android studio 3.3 at least here is the rough path I took:
在 android studio 3.3 上,至少这里是我采取的粗略路径:
I right clicked project -> open module settings -> sdk location -> uncheck use embedded jdk -> added path to new 1.8 jdk which for me it was
我右键单击项目 -> 打开模块设置 -> sdk 位置 -> 取消选中使用嵌入式 jdk -> 添加新 1.8 jdk 的路径,对我来说它是
/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home
/库/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home
回答by Shubham Sejpal
Use this path in the Default Project Structure by using the browse option go up to this Directory named home.
通过使用浏览选项在默认项目结构中使用此路径,转到名为 home 的目录。
/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home
/应用程序/Android Studio.app/Contents/jre/jdk/Contents/Home
May it works for you.
愿它对你有用。