JAVA_HOME变量 [英] JAVA_HOME variable

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

问题描述

设置我的JAVA_HOME变量指向JDK和我添加%JAVA_HOME%\\ bin添加到PATH变量。
然而,我的Ant脚本无法找到JDK。它寻找到了错误的文件夹Java编译器。这里是我得到的错误。

I set my JAVA_HOME variable to point to the jdk and I added %JAVA_HOME%\bin to the Path variable. However, my ant script is not able to find the jdk. It's looking into the wrong folder for Java compiler. here's the error I'm getting.

com.sun.tools.javac.Main不在类路径中。
也许JAVA_HOME不指向JDK。
它当前设置为 C:\\ Program Files文件\\的Java \\ JRE6

com.sun.tools.javac.Main is not on the classpath. Perhaps JAVA_HOME does not point to the JDK. It is currently set to C:\Program Files\Java\jre6

设置我的 JAVA_HOME = C:\\ Program Files文件(x86)的\\的Java \\ jdk1.7.0

我是什么做错了吗?请帮助!

What am I doing wrong? Please help!

推荐答案

如果您的Java安装目录在其路径名空间,你应该使用缩短的路径名(例如C:\\ PROGRA〜1 \\的Java \\ JRE6)在环境变量代替。

If your Java installation directory has a space in its path name, you should use the shortened path name (e.g. C:\Progra~1\Java\jre6) in the environment variable instead.


  • PROGRA〜1 ='程序文件'

  • PROGRA〜2 ='程序文件(x86)

<一个href=\"https://confluence.atlassian.com/display/DOC/Setting+the+JAVA_HOME+Variable+in+Windows\">Setting JAVA_HOME变量在Windows

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

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