我在控制面板的"系统"中找到了环境变量,并创建了两个新变量,一个用于用户变量,另一个用于系统变量.两者都被命名为JAVA_HOME,两者都指向
C:\太阳\ SDK\JDK\BIN
但由于某种原因,我在运行Java命令时仍会遇到以下错误...
BUILD FAILED
C:\Users\Derek\Desktop\eclipse\eclipse\glassfish\setup.xml:161: The following error occurred while executing this line:
C:\Users\Derek\Desktop\eclipse\eclipse\glassfish\setup.xml:141: The following error occurred while executing this line:
C:\Users\Derek\Desktop\eclipse\eclipse\glassfish\setup.xml:137: Please set java.home to a JDK installation
Total time: 1 second
C:\Users\Derek\Desktop\eclipse\eclipse\glassfish>lib\ant\bin\ant -f setup.xml
Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre6\lib\tools.jar
Buildfile: setup.xml
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
在尝试检查我正在运行的Java的当前版本时,我收到错误"'java'不被识别为内部或外部命令,可操作程序或批处理文件.".
我正在运行Windows 7操作系统,并且已经下载了最新的JDK,并且感觉我可能不小心从机器中删除了java,因为之前我能够使用命令"java -version"检查Java版本.
我必须下载什么软件才能让Java再次在我的机器上运行?
编辑:
在确保所有环境变量都指向当前的java sdk之后,我已经设法让我的cmd再次运行Java.谢谢你对我的问题的所有答案,凯伦