执行- /www/server/tomcat/bin/version.sh
复制代码 查看当前版本- Using CATALINA_BASE: /www/server/tomcat
- Using CATALINA_HOME: /www/server/tomcat
- Using CATALINA_TMPDIR: /www/server/tomcat/temp
- Using JRE_HOME: /usr/java/jdk1.8.0_121
- Using CLASSPATH: /www/server/tomcat/bin/bootstrap.jar:/www/server/tomcat/bin/tomcat-juli.jar
- Server version: Apache Tomcat/7.0.76
- Server built: Mar 9 2017 13:49:01 UTC
- Server number: 7.0.76.0
- OS Name: Linux
- OS Version: 3.10.0-514.16.1.el7.x86_64
- Architecture: amd64
- JVM Version: 1.8.0_121-b13
- JVM Vendor: Oracle Corporation
复制代码 显示当前运行为1.8
执行命令编辑/www/server/tomcat/bin/catalina.sh(你也可以用控制面板的文件管理编辑,方便)
- vi /www/server/tomcat/bin/catalina.sh
复制代码 找到- JAVA_HOME=/usr/java/jdk1.8.0_121
复制代码 修改为(/usr/local/jdk1.6.0_45为你自己的JDK目录)- JAVA_HOME=/usr/local/jdk1.6.0_45
复制代码 然后重启tomcat(你可以在模板里重启tomcat或者命令行)
然后执行查看当前版本- /www/server/tomcat/bin/version.sh
复制代码 查看是否成功- Using CATALINA_BASE: /www/server/tomcat
- Using CATALINA_HOME: /www/server/tomcat
- Using CATALINA_TMPDIR: /www/server/tomcat/temp
- Using JRE_HOME: /usr/local/jdk1.6.0_45
- Using CLASSPATH: /www/server/tomcat/bin/bootstrap.jar:/www/server/tomcat/bin/tomcat-juli.jar
- Server version: Apache Tomcat/7.0.76
- Server built: Mar 9 2017 13:49:01 UTC
- Server number: 7.0.76.0
- OS Name: Linux
- OS Version: 3.10.0-514.16.1.el7.x86_64
- Architecture: amd64
- JVM Version: 1.6.0_45-b06
- JVM Vendor: Sun Microsystems Inc
复制代码
|