带有私有 jre/jdk 的 Android Studio IDE?操作系统 [英] Android Studio IDE with private jre/jdk? OSX

查看:21
本文介绍了带有私有 jre/jdk 的 Android Studio IDE?操作系统的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 OSX 10.8,并尝试使用私有 jdk 而不是全局安装的 jdk 运行 Android Studio 应用程序包.

I'm running OSX 10.8 and was trying to run the Android Studio app bundle using a private jdk rather than one that is globally installed.

我没有任何可全局访问的 Java 安装.

I don't have any java installation globally accessible.

我过去使用 Eclipse 成功地完成了这项工作,方法是编辑 plist.info 文件并通过 eclipse.ini 文件指定我想使用的 JRE/JDK.

I have done this successfully in the past with Eclipse by editing the plist.info file and specifying what JRE/JDK I want to use via the eclipse.ini file.

我还没有发现如何使用 Android Studio 执行此操作的魔力.

I haven't found the magic on how to do this with Android Studio.

在编辑 plist 文件失败后,我打开了一个终端并将 JDK/bin 目录添加到 PATH 并设置了一个 JAVA_HOME 但这还不足以让 idea_applauncher 在我指定的位置找到 Java 安装.

After editing the plist file unsuccessfully I opened a terminal and added the JDK/bin directory to the PATH and set a JAVA_HOME but that wasn't enough for the idea_applauncher to find a Java installation where I had specified.

我不确定我还能尝试什么来实现这一点.有什么想法吗?

I'm not sure what else I could try to make this happen. Any ideas?

我没有足够的代表来发布屏幕截图,但下面是命令行与输出的样子.

I don't have enough rep to post a screenshot, but below that what the command-line looks like with the output.

当我尝试运行该包时,我收到一个弹出窗口,提示没有安装 JDK,它有两个按钮要求我安装"或现在不"

When I try to run the bundle I get a pop-up window saying there's no JDK installed and it has two buttons asking me to either "Install" or "Not Now"

$ ./idea_appLauncher

$ ./idea_appLauncher

不存在 Java 运行时,请求安装.

No Java runtime present, requesting install.

推荐答案

OSX 的另一种解决方案:转到 Applications 文件夹,右键单击 Android Studio,选择Show Package Contents".

Another solution for OSX: go to the Applications folder, right click on Android Studio, choose "Show Package Contents".

打开 Info.plist 文件.找到 JVMVersion 键,并设置您需要的字符串值.

Open the Info.plist file. Locate the JVMVersion key, and set the string value you need.

就我而言,我需要 1.7 及更高版本才能运行 RoboVM 插件,而值是 1.6*,1.7+,所以我只将其保留在 1.7+.

In my case, I needed to be 1.7 and up to be able to run the RoboVM plugin, and the value was 1.6*,1.7+, so I left it only on 1.7+.

重新启动 Android Studio,它应该会使用您需要的 JVM 版本.

Restart Android Studio and it should be using the version of the JVM you need.

如果您在 Mac 上具有 root 访问权限,则此方法有效.

This works if you have root access on your Mac.

这篇关于带有私有 jre/jdk 的 Android Studio IDE?操作系统的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆