宝塔如何手工修改tomcat的JDK版本
先执行
/www/server/tomcat/bin/version.sh
查看当前版本
Using CATALINA_BASE: /www/server/tomcatUsing CATALINA_HOME: /www/server/tomcatUsing CATALINA_TMPDIR: /www/server/tomcat/tempUsing JRE_HOME: /usr/java/jdk1.8.0_121Using CLASSPATH: /www/server/tomcat/bin/bootstrap.jar:/www/server/tomcat/bin/tomcat-juli.jarServer version: Apache Tomcat/7.0.76Server built: Mar 9 2017 13:49:01 UTCServer number:7.0.76.0OS Name: LinuxOS Version: 3.10.0-514.16.1.el7.x86_64Architecture: amd64JVM Version: 1.8.0_121-b13JVM 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/tomcatUsing CATALINA_HOME: /www/server/tomcatUsing CATALINA_TMPDIR: /www/server/tomcat/tempUsing JRE_HOME: /usr/local/jdk1.6.0_45Using CLASSPATH: /www/server/tomcat/bin/bootstrap.jar:/www/server/tomcat/bin/tomcat-juli.jarServer version: Apache Tomcat/7.0.76Server built: Mar 9 2017 13:49:01 UTCServer number:7.0.76.0OS Name: LinuxOS Version: 3.10.0-514.16.1.el7.x86_64Architecture: amd64JVM Version: 1.6.0_45-b06JVM Vendor: Sun Microsystems Inc