Tomcat没有运行,即使JAVA_HOME路径是正确的 [英] Tomcat is not running even though JAVA_HOME path is correct
问题描述
当我试图使用Tomcat的运行的startup.bat
我收到以下错误,
When I am trying to run tomcat using startup.bat
I get the following error,
The JAVA_HOME environment variable is not defined correctly
This environment variable is needed to run this program
NB: JAVA_HOME should point to a JDK not a JRE
但后来我尝试 C:\\>回声%JAVA_HOME%
,我得到以下结果。
C:\Program Files\Java\jdk1.6.0_25\bin
我甚至尝试设置 JAVA_HOME
手动系统变量列表中,但这个问题仍然存在。
I have even tried setting JAVA_HOME
manually to system variable list, but this issue remains.
我能做些什么来解决呢?
What can I do to solve it?
我使用Windows 7。
I am using Windows 7.
设置一个名为JAVA_HOME一个新的系统变量及其路径设置后C:\\ Program Files文件\\的Java \\ jdk1.6.0_25 \\ BIN \\
,我试过再次启动脚本,这个时候,我得到一个新的错误。
After setting a new system variable named JAVA_HOME and setting its path to "C:\Program Files\Java\jdk1.6.0_25\bin\"
, I tried the start up script again and this time I get a new error.
D:\Work\apache-tomcat-6.0.35\bin>startup.bat
Files\Java\jdk1.6.0_25"" was unexpected at this time.
知不知道这个错误意味着什么?
Any idea what this error means?
我甚至尝试的路径设置为C:\\ Program Files文件\\的Java \\ jdk1.6.0_25 \\
(即无斌 ),但出现同样的错误。
I even tried setting the path to "C:\Program Files\Java\jdk1.6.0_25\"
(that is without bin) but same error occurs.
推荐答案
尝试安装Java的其他地方 - 在目录中没有空格。重新设置JAVA_HOME变量,然后再试一次。我记得的Tomcat对Windows XP操作系统的一些问题,如有的变量它同时启动包含空格使用空格。也许这是与Windows 7相似。
Try installing java somewhere else - in a directory without spaces. Set again the JAVA_HOME variable and try again. I remember Tomcat had some problems on Window XP with spaces if any variables it was using while starting contained spaces. Maybe it's similar with Windows 7.
我记得我不得不改变在Tomcat中的Java类中的某些线,被处理的Tomcat启动。
I remember I had to change some lines in Tomcat java classes which were handling Tomcat startup.
@Edit:卢西亚诺打我注意到它,但你也应该从JAVA_HOME删除的bin
@ Luciano beat me to noticing it but you should also remove "bin" from JAVA_HOME
@Edit:我也记得另一个定位点(没有测试它自己,虽然)是JAVA_HOME设置为简写例如C:\\ PROGRA〜1 \\的Java \\ jdk1.6.0_25
@ I also remember that another fix (didn't test it myself, though) was to set JAVA_HOME to the shorthand version e.g. C:\Progra~1\Java\jdk1.6.0_25
这篇关于Tomcat没有运行,即使JAVA_HOME路径是正确的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!