tomcat報(bào)錯(cuò)catalina.sh: line 401: /usr/java/jdk1.7.52/bin/java: No such file or directory
將生產(chǎn)服務(wù)器的Tomcat目錄打包過來后解壓后传轰,啟動(dòng)Tomcat后捧颅,發(fā)現(xiàn)如下問題:
# ./shutdown.sh
Using CATALINA_BASE: ? /usr/local/tomcat
Using CATALINA_HOME: ? /usr/local/tomcat
Using CATALINA_TMPDIR: /usr/local/tomcat/temp
Using JRE_HOME: ? ? ? /usr/java/jdk1.7.52
/usr/local/tomcat/bin/catalina.sh: line 401: /usr/java/jdk1.7.52/bin/java: No such file or directory
其實(shí)安裝的是jdk-8u102-linux-x64.rpm东揣,其實(shí)并沒有所謂的/usr/java/dk1.7.52目錄力穗,而是/usr/java/jdk1.8.0_102/
發(fā)現(xiàn)/etc/profile文件下的jar_home指向錯(cuò)誤,
于是修改vim /etc/profile
export JAVA_HOME=/usr/java/jdk1.8.0_102/
export PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export SANP_HOME=/home/aaa
使配置生效,重新啟動(dòng)tomcat即可
source /etc/profile