linux启动tomcat报:The BASEDIR environment variable is not defined correctly
今天公司同事给公司内部测试服务器上安装了个tomcat6.0版本的,他在无法启动tomcat的时候让我来进行解决.
系统:centos 5.5
需要的软件包:apache-tomcat-6.0.36.zip
1.安装tomcat
yum -y install unzip
unzip apache-tomcat-6.0.36.zip -d /usr/local/
2.安装jdk
jdk可以去看我这篇centos安装jdk 1.6文章
3.然后设置环境变量
vi /etc/profile
export JAVA_HOME=/usr/java/default
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
CATALINA_2_BASE=/usr/local/apache-tomcat-6.0.36
CATALINA_2_HOME=/usr/local/apache-tomcat-6.0.36
export CATALINA_2_BASE CATALINA_2_HOME
TOMCAT_2_HOME=/usr/local/apache-tomcat-6.0.36
export TOMCAT_2_HOME
保存后执行:source /etc/profile
4.启动tomcat
/usr/local/apache-tomcat-6.0.36/bin/startup.sh
出现报错:
The BASEDIR environment variable is not defined correctly
This environment variable is needed to run this program
解决办法:
cd /usr/local/apache-tomcat-6.0.36/bin/
chmod +x *.sh
再次启动tomcat就ok.
系统:centos 5.5
需要的软件包:apache-tomcat-6.0.36.zip
1.安装tomcat
yum -y install unzip
unzip apache-tomcat-6.0.36.zip -d /usr/local/
2.安装jdk
jdk可以去看我这篇centos安装jdk 1.6文章
3.然后设置环境变量
vi /etc/profile
export JAVA_HOME=/usr/java/default
export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export PATH=$PATH:$JAVA_HOME/bin
CATALINA_2_BASE=/usr/local/apache-tomcat-6.0.36
CATALINA_2_HOME=/usr/local/apache-tomcat-6.0.36
export CATALINA_2_BASE CATALINA_2_HOME
TOMCAT_2_HOME=/usr/local/apache-tomcat-6.0.36
export TOMCAT_2_HOME
保存后执行:source /etc/profile
4.启动tomcat
/usr/local/apache-tomcat-6.0.36/bin/startup.sh
出现报错:
The BASEDIR environment variable is not defined correctly
This environment variable is needed to run this program
解决办法:
cd /usr/local/apache-tomcat-6.0.36/bin/
chmod +x *.sh
再次启动tomcat就ok.
评论: