指前两篇jdk与tomcat安装留下的问题
[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
原因:是我们在配置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使配置文件生效即可
参考链接