如何为android studio定义JAVA_HOME变量

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

How to defind JAVA_HOME variable for android studio

javaandroid

提问by cool

This is the first error I faced:

这是我遇到的第一个错误:

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

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

Then I set the JAVA_HOME variable:
Variable name: JAVA_HOME
Variable value: C:\Program Files\Java\jdk1.9.0

然后我设置JAVA_HOME变量:
变量名:JAVA_HOME
变量值:C:\Program Files\Java\jdk1.9.0

So I get another error:

所以我得到另一个错误:

Failed to create JVM: error code -6. JVM Path: C:\Program Files\Java\jdk1.9.0 If you already have a 32-bit JDK installed, define a JAVA_HOME variable in

未能创建 JVM:错误代码 -6。JVM 路径:C:\Program Files\Java\jdk1.9.0 如果您已经安装了 32 位 JDK,请在

What to do next?

接下来做什么?

回答by Wasiq Muhammad

After Settings restart your system enter image description here

设置后重启系统 在此处输入图片说明

回答by Andy the android

you added JAVA_HOMEas a system variable, right ?

您将JAVA_HOME添加为系统变量,对吗?

回答by cool

I download the java from the oracle website, the downloaded file name is "jdk-7u79-windows-i586" and I changed variable value to "C:\Program Files\Java\jdk1.7.0_79" so the android studio started without any problem.

我从oracle网站下载了java,下载的文件名是“jdk-7u79-windows-i586”,我将变量值更改为“C:\Program Files\Java\jdk1.7.0_79”所以android studio启动时没有任何问题。