Java 在 Mac OSX 上通过 Android Studio 和 Eclipse 使用 JDK 7 或更高版本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/23265112/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 21:34:54  来源:igfitidea点击:

Using JDK 7 Or Higher With Android Studio And Eclipse On Mac OSX

javaeclipseandroid-studioosx-mavericksjava-8

提问by rnxfod

Both Android Studio and Eclipse are asking me to install JDK 6 even though JDK 8 is already installed. Several workarounds online told me change the java_home to point the JDK 8 installation location, done that such that both /usr/libexec/java_home and java -version commands refer to the JDK 8 installation but Android Studio and Eclipse still asking me to install JDK 6. Anyone solved this issue.

即使已经安装了 JDK 8,Android Studio 和 Eclipse 都要求我安装 JDK 6。一些在线解决方法告诉我更改 java_home 以指向 JDK 8 安装位置,这样做使 /usr/libexec/java_home 和 java -version 命令都指向 JDK 8 安装,但 Android Studio 和 Eclipse 仍然要求我安装 JDK 6 . 任何人解决了这个问题。

采纳答案by user1906

Android Studio is based on Intellij Idea 13. The solution herealso applies. Just modifying Info.plist from 1.6*to 1.7*did it for me.

Android Studio 基于Intellij Idea 13这里的解决方案也适用。只需将 Info.plist 从1.6*修改为1.7*就为我做到了。

Btw, I've observed that at least Android Studio 0.5.5 uses massive amounts of memory. With Java 8 it gets over 2GB for very simple projects. With Java 7 it is still bad, but takes around 1.5GB.

顺便说一句,我观察到至少 Android Studio 0.5.5 使用了大量内存。使用 Java 8,对于非常简单的项目,它会超过 2GB。对于 Java 7,它仍然很糟糕,但需要大约 1.5GB。

回答by vaichidrewar

Changing SDK Location also works for Android Studio Project

更改 SDK 位置也适用于 Android Studio 项目

enter image description here

在此处输入图片说明

enter image description here

在此处输入图片说明