Tomcat指定JDK版本

方法一:

 

1. 修改bin目录下catalina.bat文件,tomcat7.0.55是195行处。将 %JAVA_HOME% 替换为jdk目录

 

rem ----- Execute The Requested Command ---------------------------------------

 

echo Using CATALINA_BASE:   "%CATALINA_BASE%"

echo Using CATALINA_HOME:   "%CATALINA_HOME%"

echo Using CATALINA_TMPDIR: "%CATALINA_TMPDIR%"

if ""%1"" == ""debug"" goto use_jdk

echo Using JRE_HOME:        "%JRE_HOME%"

goto java_dir_displayed

:use_jdk

echo Using JAVA_HOME:       C:\Program Files\Java\jdk1.7.0_67

:java_dir_displayed

echo Using CLASSPATH:       "%CLASSPATH%"

 

 

2. 修改setclasspath.bat文件,77行处。

 

rem Set standard command for invoking Java.

rem Note that NT requires a window name argument when using start.

rem Also note the quoting as JAVA_HOME may contain spaces.

set _RUNJAVA="C:\Program Files\Java\jdk1.7.0_67\bin\java"

set _RUNJDB="C:\Program Files\Java\jdk1.7.0_67\bin\jdb"

 

goto end

 

 

方法二:

 

在catalina.sh文件和setclasspath.sh文件开头的空白处加上如下两句(指定JDK):

export JAVA_HOME=/usr/local/java/jdk1.7.0_67
export JRE_HOME=/usr/local/java/jdk1.7.0_67/jre

你可能感兴趣的:(tomcat)