本地建网页服务器1-tomcat(Neither the JAVA_HOME)

Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

先看Tomcat的startup.bat,它调用了catalina.bat,而catalina.bat则调用了setclasspath.bat。只要在setclasspath.bat的开头声明环境变量

rem ---------------------------------------------------------------------------
rem Set CLASSPATH and Java options
rem
rem $Id: setclasspath.bat 505241 2007-02-09 10:22:58Z jfclere $
rem ---------------------------------------------------------------------------

添加加chu部分
set JAVA_HOME=C:/Program Files/Java/jdk1.7.0_02
set JRE_HOME=C:/Program Files/Java/jre7

添加加chu部分

rem Make sure prerequisite environment variables are set
if not “%JAVA_HOME%” == “” goto gotJdkHome
if not “%JRE_HOME%” == “” goto gotJreHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
echo At least one of these environment variable is needed to run this program
goto exit

猜你喜欢

转载自blog.csdn.net/jzlStudent/article/details/103455718