Linux下tomcat启动Neither the JAVA_HOME nor the JRE_HOME environment variable is defined At least one of

在linux下安装好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

原因:找不到jdk或者jre路径。

解决办法:在setclasspath.bat的开头声明环境变量,打开tomcat的bin目录下面的setclasspath.sh,添加红色部分,路径修改为自己机器jdk和jre路径即可。

 export JAVA_HOME=/opt/zimbra/jdk1.6.0_31
export JRE_HOME=/opt/zimbra/jdk1.6.0_31/jre

原文地址:https://www.cnblogs.com/ainihaozhen/p/8366723.html