1.查看服务是否启动
ps -ef |grep tomcat
结果
test 22028 1 0 Dec16 ? 00:15:36 /home/test/opt/jdk/jre/bin/java -Djava.util.logging.config.file=/home/test/opt/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Djdk.tls.ephemeralDHKeySize=2048 -Djava.protocol.handler.pkgs=org.apache.catalina.webresources -classpath /home/test/opt/tomcat/bin/bootstrap.jar:/home/test/opt/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/home/test/opt/tomcat -Dcatalina.home=/home/test/opt/tomcat -Djava.io.tmpdir=/home/test/opt/tomcat/temp org.apache.catalina.startup.Bootstrap start
test 24717 24336 0 18:49 pts/0 00:00:00 grep –color=auto tomcat
说明tomcat已经正常启动, 22028 就为进程号 pid = 22028
2.杀死进程
kill -9 22028
3.查看tomcat版本
./version.sh
4.查看java路径
whereis java
which java (java执行路径)
echo $JAVA_HOME
echo $PATH
5.配置tomcat中JAVA_HOME
export JAVA_HOME=/home/gongzi/http/jdk1.6.0_26
export JRE_HOME=/home/gongzi/http/jdk1.6.0_26/jre
6.给文件夹赋权限 sudo chmod -R 777 apache-tomcat-8.5.5