引用 错误:
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的开头声明环境变量,打开tomcat的bin目录下面的setclasspath.sh,添加红色部分,路径自己修改 #!/bin/sh # ----------------------------------------------------------------------------- # Set CLASSPATH and Java options # # $Id: setclasspath.sh 467182 2006-10-23 23:47:06Z markt $ # ----------------------------------------------------------------------------- export JAVA_HOME=/usr/lib/jvm/java-6-sun export JRE_HOME=/usr/lib/jvm/java-6-sun/jre # First clear out the user classpath CLASSPATH= # Make sure prerequisite environment variables are set if [ -z "$JAVA_HOME" -a -z "$JRE_HOME" ]; then # Bugzilla 37284 if $darwin && [ -d "/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home" ]; then export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.5/Home" else echo "Neither the JAVA_HOME nor the JRE_HOME environment variable is defined" echo "At least one of these environment variable is needed to run this program" exit 1 fi fi |
|