The JAVA_HOME environment variable is not defined correctly

tomcat启动闪退,通过cmd运行startup.bat,发现错误代码如下:

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

检查环境变量设置,都没有问题,明明都设置好了,运行的时候却偏偏找不到,原因还没找到,解决方法如下:

修改setclasspath.bat,直接在里边设置JAVA_HOME和JRE_HOME。

rem

---------------------------------------------------------------------------
rem Set CLASSPATH and Java options
rem
rem $Id: setclasspath.bat 730396 2008-12-31 13:49:30Z markt $
rem

---------------------------------------------------------------------------

set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_10
set JRE_HOME=C:\Program Files\Java\jre6

 

你可能感兴趣的:(The JAVA_HOME environment variable is not defined correctly)