I had Java 8 on my computer, but I wanted to run my Tomcat using Java 7.
The following solution worked for me.
In %CATALINA_HOME%\bin\ (E.g.: C:\Tomcat\bin) add setenv.bat having the following content:
@echo off
set JAVA_HOME=C:\Program Files\Java\jdk1.7.0_03
set JRE_HOME=%JAVA_HOME%\jre
exit /B 0
When you run startup.bat, the following calls happen:
startup.bat
|
└── catalina.bat
|
└── setenv.bat