Jdk1.5 has been installed on XP and java_home has been set, but Tomcat cannot be found during startup.
The error message is as follows: neither the java_home nor the jre_home environment variable is defined at least one of these environment variable is needed to run this program; why can't the jre_home paths of java_home be found?
The cause is unknown. The solution is as follows:
1. Analyze the startup. Bat Startup Script: It is found that Catalina. bat is called, While Catalina. Bat calls setclasspath. bat.
2. The java_home and jre_home values are defined in the header of setclasspath. bat, so manually set the java_home variable here.
Rem ---------------------------------------------------------------------------
Rem set classpath and Java options
Rem
Rem $ ID: setclasspath. Bat 505241 10: 22: 58z jfclere $
Rem ---------------------------------------------------------------------------
Set java_home = c: \ Program Files \ Java \ jdk1.5.0 _ 05
Set jre_home = c: \ Program Files \ Java \ jre1.5.0 _ 05
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
: Gotjrehome
If not exist "% jre_home % \ bin \ java.exe" Goto nojavahome
If not exist "% jre_home % \ bin \ javaw.exe" Goto nojavahome
If not "" % 1 "" = "" debug "" Goto okjavahome
Echo java_home shocould point to a JDK in order to run in debug mode.
Goto exit
: Gotjdkhome
If not exist "% java_home % \ bin \ java.exe" Goto nojavahome
If not exist "% java_home % \ bin \ javaw.exe" Goto nojavahome
If not exist "% java_home % \ bin \ jdb.exe" Goto nojavahome
If not exist "% java_home % \ bin \ javac.exe" Goto nojavahome
If not "% jre_home %" = "" Goto okjavahome
Set jre_home = % java_home %
Goto okjavahome
: Nojavahome
Echo the java_home environment variable is not defined correctly
Echo this environment variable is needed to run this program
Echo NB: java_home shocould point to a JDK not a JRE
Goto exit
: Okjavahome
If not "�sedir %" = "" Goto gotbasedir
Echo the basedir environment variable is not defined
Echo this environment variable is needed to run this program
Goto exit
: Gotbasedir
If exist "�sedir % \ bin \ setclasspath. Bat" Goto okbasedir
Echo the basedir environment variable is not defined correctly
Echo this environment variable is needed to run this program
Goto exit
: Okbasedir
Rem set the default-djava. endorsed. dirs argument
Set java_endorsed_dirs = �sedir % \ endorsed
Rem set standard classpath
Rem note that there are no quotes as we do not want to introduce random
Rem quotes into the classpath
If not exist "% java_home % \ bin \ tools. Jar" Goto nojavac
Set classpath = % java_home % \ Lib \ tools. Jar
: Nojavac
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 = "% jre_home % \ bin \ Java"
Set _ runjavaw = "% jre_home % \ bin \ javaw"
Set _ runjdb = "% java_home % \ bin \ jdb"
Set _ runjavac = "% java_home % \ bin \ javac"
Goto end
: Exit
Exit/B 1
: End
3. Restart Tomcat and enter http: // localhost: 8080 for verification. The problem is solved.
Tomcat 5 needs to be supported by jdk1.6, and jdk1.5 cannot.