启动tomcat的时候,报Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of these environment variable is needed to run this program 的解决方案

解决方法,如下所示: 

先看Tomcat的startup.bat,它调用了catalina.bat,而catalina.bat则调用了setclasspath.bat。只要在setclasspath.bat的开头声明环境变量.像我这样 : 加上红色的两句就OK拉 (当然了JAVA_HOME的路径 请填写你自己的)

rem endorsed directory.
rem ---------------------------------------------------------------------------

set JAVA_HOME=C:Program FilesJavajdk1.7.0_80

set JRE_HOME=C:Program FilesJavajdk1.7.0_80jre

rem Make sure prerequisite environment variables are set

摘自:http://blog.csdn.net/hi_kevin/article/details/6602374

原文地址:https://www.cnblogs.com/peasana/p/7641914.html