安然不哭-西坝阿超个人博客

做技术一定要一颗恒心,这样才不会半途而废。

启动tomcat时报Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

2018-3-3 钟建超

解决方法:
先看Tomcat的startup.bat,它调用了catalina.bat,而catalina.bat则调用了setclasspath.bat。只要在setclasspath.bat的开头声明环境变量.像我这样 : 加上红色的两句就OK拉 (当然了JAVA_HOME的路径 请填写你自己的)
rem —————————————————————————
rem Set CLASSPATH and Java options
rem
rem $Id: setclasspath.bat 795032 2009-07-17 10:41:20Z markt $
rem —————————————————————————

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

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

标签: java