tomcat服务未开启,启动未报错,关闭报错:/usr/local/tomcat/apache-tomcat-8.5.50/bin/catalina.sh: line 524: /usr/java/jdk/jre/bin/java: No such file or directory

0.前言:

指前两篇jdk与tomcat安装留下的问题

 

1.问题报错

  

[root@VM_16_8_centos bin]# ./shutdown.sh 
Using CATALINA_BASE:   /usr/local/tomcat/apache-tomcat-8.5.50
Using CATALINA_HOME:   /usr/local/tomcat/apache-tomcat-8.5.50
Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-8.5.50/temp
Using JRE_HOME:        /usr/java/jdk/jre
Using CLASSPATH:       /usr/local/tomcat/apache-tomcat-8.5.50/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-8.5.50/bin/tomcat-juli.jar
/usr/local/tomcat/apache-tomcat-8.5.50/bin/catalina.sh: line 524: /usr/java/jdk/jre/bin/java: No such file or directory

 

2.解决办法:

原因:是我们在配置jdk环境变量时的JRE路径

 

 jdk10以后的版本解压后是没有jre目录的

JAVA_HOME=/usr/java/jdk
JRE_HOME=/usr/java/jdk/jre
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH

所以第二行JRE_HOME需要改为JRE_HOME=$JAVA_HOME/,即:

JAVA_HOME=/usr/java/jdk
JRE_HOME=$JAVA_HOME/
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export JAVA_HOME JRE_HOME PATH CLASSPATH

 

再:source  /etc/profile使配置文件生效即可

 

 

参考链接

 

 

 

 

 

posted @ 2022-02-11 16:23  小林同学_Scorpio  阅读(1721)  评论(0编辑  收藏  举报
1