Neither the JAVA_HOME nor the JRE_HOME environment variable is defined

2013-12-04 13:53
當啟動 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
 
修正方法
在 bin/catalina.sh 中加入以下兩行
 
JAVA_HOME=/usr/java/jdk1.5.0_18
 
JAVA_OPTS="$JAVA_OPTS -server -Xms196m -Xmx512m -XX:PermSize=128m -XX:MaxNewSize=256m -XX:MaxPermSize=256m"