问题描述: 系统:win7
但是在eclipse中集成的tomcat启动后,localhost:8080不能访问
在控制台中直接运行tomcat,报错“The JAVA_HOME environment variable is not defined correctly”
在控制台中运行 java -version正确,说明java环境配置正确
解决办法:在tomcat的setclasspath.bat的头部定义了JAVA_HOME和JRE_HOME的值
rem ---------------------------------------------------------------------------
rem Set CLASSPATH and Java options
rem
rem $Id: setclasspath.bat 505241 2007-02-09 10:22:58Z jfclere $
rem ---------------------------------------------------------------------------
set JAVA_HOME=C:\Program Files\Java\jdk1.5.0_05
set JRE_HOME=C:\Program Files\Java\jre1.5.0_05
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
问题解决