在windows中设置Eclipse、tomcat的jdk路径

当我们遇到不能在环境变量中设置JAVA_HOME的时候,比如安装cognos,它需要使用ibm自带的jdk。
这个时候就需要在Eclipse、tomcat中单独来设置jdk的路径。

1、Eclipse设置jdk路径:
打开eclipse.ini文件,在
-product
org.eclipse.epp.package.jee.product
后增加:
-vm
C:\Program Files (x86)\Java\jdk1.7.0_51\bin\javaw.exe



2、在tomcat下面设置jdk路径:
①打开catalina.bat文件,在
rem Guess CATALINA_HOME if not defined
set "CURRENT_DIR=%cd%"
if not "%CATALINA_HOME%" == "" goto gotHome
set "CATALINA_HOME=%CURRENT_DIR%"
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
cd ..
set "CATALINA_HOME=%cd%"
cd "%CURRENT_DIR%"
:gotHome
中增加set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_51
变为:
rem Guess CATALINA_HOME if not defined
set "CURRENT_DIR=%cd%"
set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_51
if not "%CATALINA_HOME%" == "" goto gotHome
set "CATALINA_HOME=%CURRENT_DIR%"
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
cd ..
set "CATALINA_HOME=%cd%"
cd "%CURRENT_DIR%"
:gotHome

②打开setclasspath.bat文件,在
rem Make sure prerequisite environment variables are set
if not "%JAVA_HOME%" == "" goto gotJdkHome
if not "%JRE_HOME%" == "" goto gotJreHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
echo At least one of these environment variable is needed to run this program
goto exit
中增加set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_51
变为:
rem Make sure prerequisite environment variables are set
set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_51
if not "%JAVA_HOME%" == "" goto gotJdkHome
if not "%JRE_HOME%" == "" goto gotJreHome
echo Neither the JAVA_HOME nor the JRE_HOME environment variable is defined
echo At least one of these environment variable is needed to run this program
goto exit


linux下面操作类似

你可能感兴趣的:(在windows中设置Eclipse、tomcat的jdk路径)