Ubuntu下tomcat启动报错:Neither the JAVA_HOME nor the JRE_HOME environment variable is defined


启动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

解决方法:编辑文件 /usr/local/tomcat/bin/catalina.sh (根据你自己的jdk路径进行修改) 在文件的正文开头,即正式代码前,大概在99行添加如下代码:
export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_231
export JRE_HOME=/usr/lib/jvm/jdk1.8.0_231/jre

原文地址:https://www.cnblogs.com/51ma/p/12836538.html