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.