android studio没有找到jvm,JAVA_HOME已经设置

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

With android studio no jvm found, JAVA_HOME has been set

javaandroidinstallandroid-studio

提问by user2853108

I have a JAVA_HOME variable set to:

我有一个 JAVA_HOME 变量设置为:

C:\Program Files (x86)\Java\jdk1.7.0_45\ And the path to the jdk is: C:\Program Files (x86)\Java\jdk1.7.0_45

C:\Program Files (x86)\Java\jdk1.7.0_45\ 而jdk的路径是:C:\Program Files (x86)\Java\jdk1.7.0_45

However when I try to start android studio I get the error:

但是,当我尝试启动 android studio 时出现错误:

No JVM installation found. Please install a 64 bit JDK. If you already have a JDK installed define a JAVA_HOME variable in Computer > System Properties > System Settings > Environment Variables.

未找到 JVM 安装。请安装 64 位 JDK。如果您已经安装了 JDK,请在计算机 > 系统属性 > 系统设置 > 环境变量中定义一个 JAVA_HOME 变量。

采纳答案by hichris123

It says that it should be a 64-bit JDK. I have a feeling that you installed (at a previous time) a 32-bit version of Java. The path for all 32-bit applications in Windows 7 and Vista is:

它说它应该是一个 64 位的 JDK。我感觉您(之前)安装了 32 位版本的 Java。Windows 7 和 Vista 中所有 32 位应用程序的路径是:

C:\Program Files (x86)\

You were setting the JAVA_HOMEvariable to the 32-bit version of Java. Set your JAVA_HOMEvariable to the following:

您将JAVA_HOME变量设置为32 位版本的 Java。将您的JAVA_HOME变量设置为以下内容:

C:\Program Files\Java\jdk1.7.0_45

If that does not work, check that the JDK version is 1.7.0_45. If not, change the JAVA_HOMEvariable to (with JAVAVERSIONas the Java version number:

如果这不起作用,请检查 JDK 版本是否为 1.7.0_45。如果没有,请将JAVA_HOME变量更改为(使用JAVAVERSIONJava 版本号:

C:\Program Files\Java\jdkJAVAVERSION

回答by Rahul Gupta

Here is the tutorial :- http://javatechig.com/android/installing-android-studioand http://codearetoy.wordpress.com/2010/12/23/jdk-not-found-on-installing-android-sdk/

这是教程:- http://javatechig.com/android/installing-android-studiohttp://codearetoy.wordpress.com/2010/12/23/jdk-not-found-on-installing-android-软件开发工具包/

Adding a system variable JDK_HOME with value c:\Program Files\Java\jdk1.7.0_21\ worked for me. The latest Java release can be downloaded here. Additionally, make sure the variable JAVA_HOME is also set with the above location.

添加值为 c:\Program Files\Java\jdk1.7.0_21\ 的系统变量 JDK_HOME 对我有用。可以在此处下载最新的 Java 版本。此外,请确保变量 JAVA_HOME 也设置为上述位置。

Please note that the above location is my java location. Please post your location in the path

请注意,上面的位置是我的java位置。请在路径中发布您的位置

回答by ejmin

When you set to install it "for all users" (not for the current user only), you won't need to route Android Studio for the JAVA_HOME. Of course, have JDK installed.

当您设置为“为所有用户”安装它时(不是只为当前用户),您将不需要为 JAVA_HOME 路由 Android Studio。当然,已经安装了JDK。

回答by praveenb

Though, the question is asked long back, I see this same issue recently after installing Android Studio 2.1.0v, and JDK 7.80 on my PC Windows 10, 32 bit OS. I got this error.

不过,这个问题很久以前就被问到了,我最近在我的 PC Windows 10、32 位操作系统上安装了 Android Studio 2.1.0v 和 JDK 7.80 后看到了同样的问题。我收到了这个错误。

No JVM installation found. Please install a 32 bit JDK. If you already have a JDK installed define a JAVA_HOME variable in Computer > System Properties > System Settings > Environment Variables.

未找到 JVM 安装。请安装 32 位 JDK。如果您已经安装了 JDK,请在计算机 > 系统属性 > 系统设置 > 环境变量中定义一个 JAVA_HOME 变量。

I tried different ways to fix this nothing worked. But As per System Requirements in this Android developer website link.

我尝试了不同的方法来解决这个问题,但没有任何效果。但根据此 Android 开发人员网站链接中的系统要求。

Its solved after installing JDK 8(jdk-8u101-windows-i586.exe) JDK download site link.

它在安装 JDK 8(jdk-8u101-windows-i586.exe) JDK 下载站点链接后解决

Hope it helps somebody.

希望它可以帮助某人。

回答by zackygaurav

For me the case was completely different. I had created a studio64.exe.vmoptionsfile in C:\Users\YourUserName\.AndroidStudio3.4\config. In that folder, I had a typo of extra spaces. Due to that I was getting the same error.

对我来说,情况完全不同。我在C:\Users\YourUserName\.AndroidStudio3.4\config 中创建了一个studio64.exe.vmoptions文件。在那个文件夹中,我有一个额外空格的拼写错误。因此,我遇到了同样的错误。

I replaced the studio64.exe.vmoptions with the following code.

我用以下代码替换了 studio64.exe.vmoptions。

# custom Android Studio VM options, see https://developer.android.com/studio/intro/studio-config.html

-server
-Xms1G
-Xmx8G
# I have 8GB RAM so it is 8G. Replace it with your RAM size.
-XX:MaxPermSize=1G
-XX:ReservedCodeCacheSize=512m
-XX:+UseCompressedOops
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-da
-Djna.nosys=true
-Djna.boot.library.path=

-Djna.debug_load=true
-Djna.debug_load.jna=true
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:+HeapDumpOnOutOfMemoryError
-Didea.paths.selector=AndroidStudio2.1
-Didea.platform.prefix=AndroidStudio

回答by terap30

Just delete the folder highlighted below. Depending on your Android Studio version, mine is 3.5 and reopen Android studio.

只需删除下面突出显示的文件夹。根据您的 Android Studio 版本,我的是 3.5 并重新打开 Android Studio。

enter image description here

在此处输入图片说明