设置JAVA_HOME变量时出现问题 [英] Problems setting the JAVA_HOME variable

查看:138
本文介绍了设置JAVA_HOME变量时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我刚刚下载了Android Studio,并尝试设置JAVA_HOME变量,以便可以运行它.我使用的是Windows 8,但没有按照所有我能找到的说明进行操作...转至高级系统设置>环境变量,然后将JAVA_HOME变量设置为包含我的jre7路径的值.我已经对该路径进行了100百万次仔细检查,但没有发现任何错误(C:\ Program Files(x86)\ Java \ jre7).我知道变量名正确,而且我知道Windows除了该变量之外,我什至重新启动了两次.我在这里做错了什么?我唯一想到的可能是错误的事实是,我指向的是jre而不是jdk,但我一直认为这两种方法都有效...无论如何,我尝试时得到的确切错误消息打开Android Studio时说:

So I just downloaded Android Studio, and am trying to set the JAVA_HOME variable so I can run it. I'm using windows 8 and have followed all the instructions I've been able to find to no avail... went to advanced system settings > environment variables and then set the JAVA_HOME variable with the value containing my path to jre7. I've double checked the path a million times, I don't see anything wrong with it(C:\Program Files (x86)\Java\jre7). I know the variable name is right, and I know that windows is excepting the variable, I've even restarted twice. What am I doing wrong here? The only thing I can think of that may be wrong is the fact that I'm pointing to a jre instead of a jdk, but I've always thought that both worked... anyway, the exact error message I get when I try to open Android Studio says:

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

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.

如果用jre不能代替jdk,那我该怎么办呢?我对Java一无所知,我只想进入这个IDE并在Android上玩转.

If a jre doesn't work in place of a jdk, then how do I go about getting one? I know nothing about Java I just want to get into this IDE and play around with Android.

推荐答案

未找到JVM安装.请安装64位JDK.

No JVM installation found. Please install a 64-bit JDK.

它要求一个64位的JDK.您说您的环境变量指向以下目录:

It's asking for a 64-bit JDK. You say your environment variable is pointing at the following directory:

C:\ Program Files(x86)\ Java \ jre7

C:\Program Files (x86)\Java\jre7

这里有两个错误.首先,您要指向JRE-Java运行时环境.这不是不是 JDK -Java开发工具包.JRE用于运行Java应用程序.JDK用于开发 Java应用程序.那里有很大的区别.

There's two things wrong here. First, you're pointing to a JRE - Java Runtime Environment. This is not a JDK - Java Development Kit. The JRE is for running Java applications; the JDK is for developing Java applications. There's a significant difference there.

第二,正如其他人所提到的,您将环境变量指向32位版本.您需要一个64位JDK.默认情况下,它将安装在 C:\ Program Files \ Java \ jdk1.7.0_XX 或类似位置.

Secondly, as others have mentioned, you're pointing the environment variable to the 32-bit version. You need a 64-bit JDK. This will be installed at C:\Program Files\Java\jdk1.7.0_XX or similar, by default.

您可以从 Oracle 获取JDK安装.

You can acquire a JDK installation from Oracle.

这篇关于设置JAVA_HOME变量时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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