简体   繁体   English

Android Studio无法找到有效的Jvm(与MAC OS相关)

[英]Android Studio was unable to find a valid Jvm (Related to MAC OS)

我无法在Mac OS上启动Android Studio for Android开发(10.10.1 - Yosemite)

Open the application package for Android Studio in finder, and edit the Info.plist file. 在finder中打开Android Studio的应用程序包,然后编辑Info.plist文件。 Change the key JVMversion. 更改密钥JVMversion。 Put 1.6+ instead of 1.6*. 放1.6+而不是1.6 *。 That worked for me!. 这对我有用!

Cheers! 干杯!

Edited: 编辑:

While this was necessary in older versions of Android Studio, this is no longer recommended. 虽然这在旧版Android Studio中是必需的,但不再推荐使用此功能。 See the official statement 见官方声明

"Please note: Do not edit Info.plist to pick a different version. That will break not only the application signature, but also future patch updates to your installation." “请注意:不要编辑Info.plist以选择其他版本。这不仅会破坏应用程序签名,还会破坏您安装的未来补丁更新。”

Antonio Jose's answer is the correct one. 安东尼奥何塞的回答是正确的。

Thanks aried3r! 谢谢aried3r!

Just install this guy here 只需在这里安装这个人

http://support.apple.com/kb/DL1572?viewlocale=en_US&locale=en_US http://support.apple.com/kb/DL1572?viewlocale=en_US&locale=en_US

and you should be good. 你应该好。

[Update] [更新]
This is fixed in Android Studio 1.1 https://issuetracker.google.com/issues/37015035 这已在Android Studio 1.1 https://issuetracker.google.com/issues/37015035中修复

In the next version of Android Studio, if no java 6 is found but 7 (or greater) is found then it will use that instead. 在Android Studio的下一个版本中,如果找不到java 6但是找到7(或更高版本),那么它将使用它。 We still recommend running studio with Java 6 due to improved font rendering, but there is no work around needed if, for example, only java 8 is found. 由于改进了字体渲染,我们仍然建议使用Java 6运行工作室,但是,例如,如果只找到java 8,则无需解决问题。

[End Update] [结束更新]

From Android Studio 1.0 RC3 Notes 来自Android Studio 1.0 RC3 Notes

As of RC 3, we have a better mechanism for customizing properties for the launchers on all three platforms. 从RC 3开始,我们有一个更好的机制来为所有三个平台上的启动器定制属性。 You should not edit any files in the IDE installation directory. 您不应编辑IDE安装目录中的任何文件。 Instead, you can customize the attributes by creating your own .properties or .vmoptions files in the following directories. 相反,您可以通过在以下目录中创建自己的.properties或.vmoptions文件来自定义属性。 (This has been possible on some platforms before, but it required you to copy and change the entire contents of the files. With the latest changes these properties are now additive instead such that you can set just the attributes you care about, and the rest will use the defaults from the IDE installation). (这在以前的某些平台上是可行的,但它需要你复制和更改文件的全部内容。通过最新的更改,这些属性现在是添加的,这样你可以只设置你关心的属性,其余的将使用IDE安装中的默认值)。

However there is no explanation about what options are. 但是没有解释什么选项。

After searching a little I found this 经过一番搜索,我发现了这个
Adjusting VM Options for Android Studio on Mac 在Mac上调整Android Studio的VM选项
IntelliJ IDEA 14.0.0 Web Help/File IDEA.Properties IntelliJ IDEA 14.0.0 Web帮助/文件IDEA.Properties

However no luck with that. 然而,没有运气。

Fortunately I was able to resolve it on Yosemite using environment variables as said in the 1.0 RC3 Release Notes. 幸运的是,我能够使用环境变量在Yosemite上解决它,如1.0 RC3发行说明中所述。

You can also place use environment variables to point to specific override files elsewhere: 您还可以使用环境变量指向其他位置的特定覆盖文件:
STUDIO_VM_OPTIONS, which vmoptions file to use STUDIO_VM_OPTIONS,要使用的vmoptions文件
STUDIO_PROPERTIES, which property file to use STUDIO_PROPERTIES,要使用的属性文件
STUDIO_JDK, which JDK to run studio with STUDIO_JDK,JDK用于运行工作室

This was a little tricky because Android Studio is not a command line application so I had to use a AppleScript command to set the environment variable when login. 这有点棘手,因为Android Studio不是命令行应用程序,所以我必须使用AppleScript命令在登录时设置环境变量。 More info here 更多信息在这里

This is my launchctl command for the command line. 这是我对命令行的launchctl命令。

launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk

And this my AppleScript (remember to save it as an Application) 这是我的AppleScript(记得把它保存为应用程序)

do shell script "launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk"

About launchctl, see here 关于launchctl,请看这里

Note that this last variable allows you to for example run Android Studio with Java 7 on OSX (which normally picks Java 6 from the version specified in Info.plist): 请注意,最后一个变量允许您在OSX上运行带有Java 7的Android Studio(通常从Info.plist中指定的版本中选择Java 6):

$ export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk $ export STUDIO_JDK = / Library / Java / JavaVirtualMachines / jdk1.7.0_67.jdk

$ open /Applications/Android\\ Studio.app $ open / Applications / Android \\ Studio.app

Worked for me 为我工作

Change this key in the Info.plist Info.plist更改此密钥

I changed from 我改变了

<key>JVMVersion</key>
<string>1.6*</string>

to

<key>JVMVersion</key>
<string>1.8*</string>

and it worked fine now.. 它现在工作正常..

Edited: 编辑:
Per the official statement as mentioned above by hasternet and aried3r, the solution by Antonio Jose is correct. 根据hasternet和aried3r上面提到的官方声明,Antonio Jose的解决方案是正确的。

Thanks! 谢谢!

As a novice user it took me a while to understand how to fix this in a correct way. 作为新手用户,我花了一些时间来了解如何以正确的方式解决这个问题。 After searching and understating many answers on SO I came out with the Following steps that you need to follow to fix the issue. 在搜索并低估了许多答案后,我发布了以下步骤,您需要遵循以解决问题。

Please Note: 请注意:

Although the simplest solution is to update the Info.plist of android studio . 虽然最简单的解决方案是更新android studio的Info.plist But it is not recommended and not the correct way to fix it . 但不建议这样做,也不是正确的修复方法。

Official statement- "Please note: Do not edit Info.plist to pick a different version. That will break not only the application signature, but also future patch updates to your installation." 官方声明 - “请注意:不要编辑Info.plist以选择其他版本。这不仅会破坏应用程序签名,还会破坏您安装的未来补丁更新。”

First Solution : If you run your Android Studio from command line, you can add these two lines into your .bash_profile 第一个解决方案:如果您从命令行运行Android Studio,则可以将这两行添加到.bash_profile中

$ export STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.7.0_67.jdk

$ open /Applications/Android\ Studio.app

From next time whenever you open your terminal your studio will start automatically. 从下次打开终端时,您的工作室将自动启动。

Second Solution: If you want to run Android Studio from UI(by click on Icon) follow below steps: 第二个解决方案:如果您想从UI运行Android Studio(通过单击Icon),请按照以下步骤操作:

  1. Open script editor on mac(one can find it in spotlight ) 在Mac上打开脚本编辑器 (可以在聚光灯下找到它)
  2. Copy past the below line 复制过以下行

    do shell script "launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk" 做shell脚本“launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk”

Note :- Change the jdk version according to your version. 注意: -根据您的版本更改jdk版本。 To check which version you are using open terminal and run the following command 要检查您使用的是哪个版本的打开终端并运行以下命令

java -version

3.Now save (⌘+s) as File format: Application . 3.现在保存(⌘+ s)为文件格式: 应用程序 Finally open System Settings → Users & Groups → Login Items and add your new application that you have just created. 最后打开系统设置→用户和组→登录项,然后添加刚刚创建的新应用程序。

  1. Log-off and login again or you can run that application manually as well.. 注销并再次登录,或者您也可以手动运行该应用程序。

woolaaaa…Its done. woolaaaa ...完成了。

References : 参考文献:

Antonio Jose's answer 安东尼奥何塞的回答

ruario's answer 鲁瓦里奥的答案

I am using Mac OS X 10.10 also. 我也在使用Mac OS X 10.10。 And to fix this problem. 并解决这个问题。

  1. Open Android Studio application package content (by right click on Android Studio icon in Application folder) 打开Android Studio应用程序包内容(右键单击Application文件夹中的Android Studio图标)
  2. Open file Infor.plist 打开文件Infor.plist
  3. Search and replace: 搜索和替换:

     <key> JVM version</key> <string>1.6*</string> 

replaced by: 取而代之:

    <key> JVM version</key>
    <string>1.6+</string>

That's it! 而已!

On Mac OS X Yosemite just install: 在Mac OS X Yosemite上安装:

Java SE Development Kit 8 Java SE开发工具包8

and

Java Version 8 Update 25 Java版本8更新25

It's all, work for me! 这一切,对我有用!

  1. Install newest JDK (8u102 current) 安装最新的JDK(8u102电流)
  2. Set envirionment variable STUDIO_JDK ( java_home outputs the Java home dir and sed strips two folders to get the jdk dir) 设置STUDIO_JDK变量STUDIO_JDKjava_home输出Java home目录和sed剥离两个文件夹以获取jdk目录)

    launchctl setenv STUDIO_JDK `/usr/libexec/java_home -version 1.8 | sed 's/\\/Contents\\/Home//g'`

  3. Launch Android Studio like you would normally 像往常一样启动Android Studio

Set STUDIO_JDK on every reboot 每次重启时设置STUDIO_JDK

The above steps only works for the current session. 以上步骤仅适用于当前会话。 Here is how to create a plist file in /Library/LaunchDaemons that runs the above command on every boot: 以下是如何在/ Library / LaunchDaemons中创建一个plist文件,在每次启动时运行上述命令:

sudo defaults write /Library/LaunchDaemons/com.google.studiojdk Label STUDIO_JDK
sudo defaults write /Library/LaunchDaemons/com.google.studiojdk ProgramArguments -array /bin/launchctl setenv STUDIO_JDK `/usr/libexec/java_home | sed 's/\/Contents\/Home//g'`
sudo defaults write /Library/LaunchDaemons/com.google.studiojdk RunAtLoad -bool TRUE

Found out about the plist trick thanks to http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-mac-os-x-launchd-plist/ 通过http://www.dowdandassociates.com/blog/content/howto-set-an-environment-variable-in-mac-os-x-launchd-plist/找到关于plist技巧的信息

On Android Tools Project Site, there is a great explanation Mac OSX JDK Selection . 在Android工具项目网站上,有一个很好的解释Mac OSX JDK选择 It fixed my problem. 它解决了我的问题。 In summary: 综上所述:

Android Studio requires two different JDKs: Android Studio需要两个不同的JDK:

  • The version of Java that the IDE itself runs with. IDE本身运行的Java版本。
  • The version of the JDK that it uses to get the Java compiler from 用于从中获取Java编译器的JDK版本

These two can be (and usually are) the same, but you can configure them individually. 这两个可以(通常是)相同,但您可以单独配置它们。 And on OSX in particular, they will often be different. 特别是在OSX上,它们通常会有所不同。

and for Yosemite (Mac OSX 10.10) Issues: 和Yosemite(Mac OSX 10.10)问题:

First, please make sure that you have the latest version of Java 6 installed; 首先,请确保安装了最新版本的Java 6; in some cases that has fixed the problems: http://support.apple.com/kb/DL1572 在某些情况下,已修复问题: http//support.apple.com/kb/DL1572

If not, try running a recent version of Java 7 or Java 8 instead by setting STUDIO_JDK as described above. 如果没有,请尝试运行最新版本的Java 7或Java 8,如上所述设置STUDIO_JDK。 That is reported to have fixed the other problems (though you will get the font rendering shown for Java 8 above.) 据报道,这已解决了其他问题(尽管您将获得上面针对Java 8显示的字体呈现。)

Java was uninstalled when I updated to OS X El Capitan. 当我更新到OS X El Capitan时,Java被卸载了。

See screenshot of terminal before and after I reinstalled Java. 在重新安装Java之前和之后查看终端的屏幕截图。

在此输入图像描述

To reinstall Java I followed this link that was provided in the Android Studio dialog box. 要重新安装Java,请按照Android Studio对话框中提供的链接进行操作。

在此输入图像描述

Android Studio ran again after the Java installation was reinstalled. 重新安装Java安装后,Android Studio再次运行。

Edit the android studio's Info.plist file in the package so that it uses 1.7 or whatever JVMVersion you have installed. 编辑包中的android studio的Info.plist文件,以便它使用1.7或您安装的任何JVMVersion。 Changing the JVMVersion to 1.6+ instead of 1.6* as hasternet answered above should work too. 将上述回答的JVMVersion更改为1.6+而不是1.6 *也应该有效。

The above works but is not recommended see RC3 Release Notes 以上工作但不建议参见RC3发行说明

As of RC 3, we have a better mechanism for customizing properties for the launchers on all three platforms. 从RC 3开始,我们有一个更好的机制来为所有三个平台上的启动器定制属性。 You should not edit any files in the IDE installation directory . 您不应编辑IDE安装目录中的任何文件 Instead, you can customize the attributes by creating your own .properties or .vmoptions files in the following directories. 相反,您可以通过在以下目录中创建自己的.properties或.vmoptions文件来自定义属性。 (This has been possible on some platforms before, but it required you to copy and change the entire contents of the files. With the latest changes these properties are now additive instead such that you can set just the attributes you care about, and the rest will use the defaults from the IDE installation). (这在以前的某些平台上是可行的,但它需要你复制和更改文件的全部内容。通过最新的更改,这些属性现在是添加的,这样你可以只设置你关心的属性,其余的将使用IDE安装中的默认值)。

see Android Studio failed to load JVM on Mac OSX (Mavericks) Android Studio无法在Mac OSX上加载JVM(Mavericks)

I have same problem and fixed with this way: 我有同样的问题,并以这种方式修复:

You should install Java from Official Apple page. 您应该从官方Apple页面安装Java。

http://support.apple.com/kb/DL1572 http://support.apple.com/kb/DL1572

This one work for me, very simple, just export the environmentable var. 这个对我有用,非常简单,只需导出环境变量。 but make sure u have the valid JVM first though. 但请确保您首先拥有有效的JVM。

https://code.google.com/p/android/issues/detail?id=82378 https://code.google.com/p/android/issues/detail?id=82378

On Mac OS X Yosemite just install: 在Mac OS X Yosemite上安装:

Java SE Development Kit 8 Java SE开发工具包8

and

Java Version 8 Update 25 Java版本8更新25

It's all, work for me too! 这一切,也为我工作! like gehev said , so simple ! 像gehev说的那么简单!

You can implement the STUDIO_JDK solution using your user's launch agents. 您可以使用用户的启动代理实施STUDIO_JDK解决方案。 This involves creating one plist file in your LaunchAgents directory, located at ~/Library/LaunchAgents 这涉及在LaunchAgents目录中创建一个plist文件,该目录位于~/Library/LaunchAgents

Create a new file, ~/Library/LaunchAgents/UNIQUE_KEY.plist , where UNIQUE_KEY is just an identifier. 创建一个新文件~/Library/LaunchAgents/UNIQUE_KEY.plist ,其中UNIQUE_KEY只是一个标识符。 I use com. 我用com。 username .androidstudio. 用户名 .androidstudio。

Copy the following text into your new plist file and modify it according the instructions below. 将以下文本复制到新的plist文件中,并按照以下说明进行修改。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
   <key>Label</key>
   <string>UNIQUE_KEY</string>
   <key>ProgramArguments</key>
   <array>
      <string>sh</string>
      <string>-c</string>
      <string>launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk</string>
   </array>
   <key>RunAtLoad</key>
   <true/>
</dict>
</plist>

You will need to make two modifications: 您需要进行两项修改:

  1. Change UNIQUE_KEY to match your filename (without the .plist extension). 更改UNIQUE_KEY以匹配您的文件名(不带.plist扩展名)。
  2. Verify your JDK path is correct and change if necessary. 验证您的JDK路径是否正确,并在必要时进行更改。 I'm using 7u71 in this example. 我在这个例子中使用的是7u71。

This is the same underlying solution as Antonio Jose's answer . 这与Antonio Jose的回答是相同的基本解决方案。 It sets the STUDIO_JDK environment variable based on the Android Studio version 1.0 RC3 release notes . 它根据Android Studio版本1.0 RC3发行说明设置STUDIO_JDK环境变量。 This solution uses the LaunchAgents directory rather than AppleScript to set the environment variable. 此解决方案使用LaunchAgents目录而不是AppleScript来设置环境变量。 As such it is mostly a difference in how your order and organize your system and environment variables. 因此,您的订单和组织系统和环境变量的方式大多不同。

Do not edit the plist. 不要编辑plist。 These instructions worked for me the first time I installed Android Studio a few months ago as well as just today. 几个月前和今天我第一次安装Android Studio时,这些说明对我有用。 (1/21/2015) (2015年1月21日)

All you need to do is a few simple things, although they aren't really listed on Google's website. 您需要做的只是一些简单的事情,尽管它们并未真正列在Google的网站上。

  1. First you need Java installed. 首先,您需要安装Java。 this is not the JDK, it is seperate. 这不是JDK,它是分开的。 You can get that from this link. 你可以从这个链接获得 If you don't have this it will probably throw an error saying something like "no JVM installed." 如果你没有这个,它可能会抛出错误,说“没有安装JVM ”。
  2. Second you need the Java JDK, I got JDK 7 from this link. 其次你需要Java JDK,我从这个链接获得了JDK 7 Make sure to choose the Mac OS X link under the Java SE Development Kit 7u75 heading. 确保选择Java SE Development Kit 7u75标题下的Mac OS X链接。 If you don't have this it will probably throw an error saying something like "no JDK installed." 如果你没有这个,它可能会抛出错误,说“没有安装JDK ”。
  3. If you haven't already installed Android Studio, do that. 如果您尚未安装Android Studio,请执行此操作。 But I'm sure you've already done that by now. 但我相信你现在已经做到了。

As @Gerard suggested, I summerise my original comment ( https://stackoverflow.com/a/27370525/763459 ) as an Answer, hope it can help others who are annoyed by this issue. 正如@Gerard所建议的那样,我将我的原始评论( https://stackoverflow.com/a/27370525/763459 )作为答案,请希望它可以帮助那些对此问题感到恼火的人。

There's a way without running the AppleScript: edit .bash_profile (if this file doesn't exist, please create a new one , as @Gerard suggested, you can to use source .bash_profile for the first time). 有一种方法可以不运行AppleScript:编辑.bash_profile (如果此文件不存在,请创建一个新文件,如@Gerard建议的那样,您可以首次使用source .bash_profile )。

  • Install the legacy Java (may be neccessary) http://support.apple.com/kb/DL1572 安装旧Java(可能是必需的) http://support.apple.com/kb/DL1572

  • Put export STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk 放出出口STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_31.jdk

  • Then quit terminal (or any text editors you're using to edit this file), run the Android Studio and viola 然后退出终端(或您用来编辑此文件的任何文本编辑器),运行Android Studio和中提琴

Tested with OSX 10.10 and Android 1.0.1 使用OSX 10.10和Android 1.0.1进行测试

Android Studio will read settings from the file ~/Library/Preferences/AndroidStudio/idea.properties. Android Studio将从〜/ Library / Preferences / AndroidStudio / idea.properties文件中读取设置。 I created this file and in it have the path to my jdk : 我创建了这个文件,并在其中有我的jdk的路径:

STUDIO_JDK=/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk STUDIO_JDK = /图书馆/的Java / JavaVirtualMachines / jdk1.8.0_45.jdk

No editing of the Info.plist necessary! 无需编辑Info.plist!

"On Mac OS, run Android Studio with Java Runtime Environment (JRE) 6 for optimized font rendering. You can then configure your project to use Java Development Kit (JDK) 6 or JDK 7." “在Mac OS上,使用Java Runtime Environment(JRE)6运行Android Studio以优化字体渲染。然后,您可以将项目配置为使用Java Development Kit(JDK)6或JDK 7。”

This was listed in http://developer.android.com/sdk/index.html under the system requirements for Mac OS X. 这是根据Mac OS X的系统要求在http://developer.android.com/sdk/index.html中列出的。

Once you install Java 6 (not the JDK) from Apple as per Alonso C. Licks, you should be able to open Android Studio and reconfigure as you wish without having to mess around in the terminal, info.plist file, or other libraries. 按照Alonso C. Licks的说法从Apple安装Java 6(而不是JDK)后,您应该可以打开Android Studio并根据需要重新配置,而不必在终端,info.plist文件或其他库中乱七八糟。

I have downloaded Intellij Idea. 我已经下载了Intellij Idea。 When I try to install Intellij, a pop-up appeared that my Mac is missing with Java RE, do you want to download it? 当我尝试安装Intellij时,出现了弹出窗口,我的Mac缺少Java RE,你想下载吗? After I downloaded missing package using Intellij, I could open Android Studio. 在使用Intellij下载丢失的软件包后,我可以打开Android Studio。

我通过将Info.plist文件中的JVM版本更改为1.7 *解决了此问题

我跑了这个坏男孩:

launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/

i'm dealing with the same problem and i get it worked. 我正在处理同样的问题,我觉得它有用。

it is probably that your jdk version is not right. 可能是你的jdk版本不对。

now i installed jdk1.8 and it is ok now. 现在我安装了jdk1.8,现在还可以。

For those who were having trouble creating a script that launched on startup, as an alternative you can add this .plist to your LaunchAgents folder. 对于那些在创建启动时启动的脚本时遇到问题的用户,可以将此.plist添加到LaunchAgents文件夹中。 This may be a more appropriate way of adding environment variables to the system since Yosemite decided to do away with launchd.conf. 这可能是向系统添加环境变量的更合适的方式,因为Yosemite决定取消使用launchd.conf。 This should also work across user accounts due to the nature of the LaunchAgents folder, but I haven't tested that. 由于LaunchAgents文件夹的性质,这也适用于用户帐户,但我没有测试过。

To do this, create a .plist file with the following name and path: 为此,请使用以下名称和路径创建.plist文件:

/Library/LaunchAgents/setenv.STUDIO_JDK.plist

and the contents: 和内容:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
            <string>setenv.STUDIO_JDK</string>
        <key>ProgramArguments</key>
            <array>
                <string>sh</string>
                <string>-c</string>
                <string>
                    launchctl setenv STUDIO_JDK /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk
                </string>
            </array>
        <key>RunAtLoad</key>
            <true/>
        <key>ServiceIPC</key>
            <false/>
        <key>LaunchOnlyOnce</key>
            <true/>
        <key>KeepAlive</key>
            <false/>
    </dict>
</plist>

Then change file properties by running the following commands in Terminal: 然后通过在终端中运行以下命令来更改文件属性:

sudo chmod 644 /Library/LaunchAgents/setenv.STUDIO_JDK.plist

sudo chown root /Library/LaunchAgents/setenv.STUDIO_JDK.plist

sudo chgrp wheel /Library/LaunchAgents/setenv.STUDIO_JDK.plist

Notes: 笔记:

1) You may need to change 'jdk1.8.0_25.jdk' to match the version that you have on your computer. 1)您可能需要更改“jdk1.8.0_25.jdk”以匹配您计算机上的版本。

2) I tried to use "jdk1.8.*.jdk" to try and account for varying Java * versions, but when I opened Android Studio I got the no JVM error even though if you run "echo $STUDIO_JDK" it returns the correct path. 2)我尝试使用“jdk1.8。*。jdk”来尝试和解释不同的Java *版本,但是当我打开Android Studio时,我得到了没有JVM错误,即使你运行“echo $ STUDIO_JDK”它返回正确的道路。 Perhaps someone has some insight as to how to fix that issue. 也许有人对如何解决这个问题有一些了解。

Try downloading the Java from Apple Support Page: http://support.apple.com/kb/DL1572 if that doesn't work for you or fails to load ( very common issue ), just follow this link to download and install the Java version you need: 尝试从Apple支持页面下载Java: http//support.apple.com/kb/DL1572如果这对您不起作用或无法加载( 非常常见的问题 ),请点击此链接下载并安装Java你需要的版本:

http://support.apple.com/downloads/DL1572/en_US/JavaForOSX2014-001.dmg http://support.apple.com/downloads/DL1572/en_US/JavaForOSX2014-001.dmg

That's it. 而已。

I had previously uninstall Java 6 and install Java 7, Android Studio was working okay, then I upgraded Android Studio and I had the issue everyone is having. 我以前卸载了Java 6并安装了Java 7,Android Studio工作正常,然后我升级了Android Studio,我遇到了每个人都有的问题。 Today, I uninstalled Java 7 and installed Java 8 from Oracle. 今天,我卸载了Java 7并从Oracle安装了Java 8。 Then I uninstall Android Studio and installed the latest. 然后我卸载Android Studio并安装了最新版本。 Everything is working for me now 现在一切都在为我工作

I was able to get it to work by editing the info.plist changing 16* to 16+. 我能够通过编辑将16 *更改为16+的info.plist来使其工作。 Tried using the recommended method but that failed. 尝试使用推荐的方法,但失败了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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