-1

Read this tutorial but it doesn't work on my end. Also i couldn't change my JAVA_HOME because other applications are using it. How do configure Tomcat 7 to use a different jdk or jre 7 that is installed on my system?

I am using windows 7 and I have found this line in Catalina.bat but placing path of my java 7 installation directory in place of JAVA_HOME isn't working

if ""%1"" == ""debug"" goto use_jdk
echo Using JRE_HOME:        "%JRE_HOME%"
goto java_dir_displayed
:use_jdk
echo Using JAVA_HOME:       "%JAVA_HOME%"

Found a solution here

Just added a new batch file setenv.bat and saved the file in TOMCAT_INSTALLATION_DIRECTORY\bin\setenv.bat or %CATALINA_BASE%/bin/setenv.bat and restarted tomcat server.

Community
  • 1
  • 1
dimas
  • 2,487
  • 6
  • 40
  • 66

1 Answers1

1

catalina.bat should have setLocal endLocal

which means when batch file runs it uses that JAVA_HOME but on exiting it does not change system variable for other apps

changing bat file should work

Kalpesh Soni
  • 6,879
  • 2
  • 56
  • 59