Direct-click Startup.bat under Windows to start Tomcat service

Source: Internet
Author: User
Tags goto tomcat

On the XP has already installed the JDK1.5 and set up the Java_home, but the Tomcat is not found in the boot process.

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 I s needed to run this program; java_home jre_home path is not found, what solution?

The reason is not known, the following to see the solution:

1, Analysis Startup.bat startup script: found that it called Catalina.bat, and Catalina.bat called Setclasspath.bat

2, the Java_home and jre_home values are defined in the head of the Setclasspath.bat, then manually set the Java_home variable here

Rem

REM Set CLASSPATH and Java options

Rem

REM $Id: Setclasspath.bat 505241 2007-02-09 10:22:58z jfclere $

Rem

Set Java_home=c:program filesjavajdk1.5.0_05

Set Jre_home=c:program filesjavajre1.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 the environment variable is needed to run this program

Goto exit

: Gotjrehome

If not exist "%jre_home%binjava.exe" goto nojavahome

If not exist "%jre_home%binjavaw.exe" goto nojavahome

If not "%1" "= =" "Debug" goto Okjavahome

Echo Java_home should point to a JDK in order to run in debug mode.

Goto exit

: Gotjdkhome

If not exist "%java_home%binjava.exe" goto nojavahome

If not exist "%java_home%binjavaw.exe" goto nojavahome

If not exist "%java_home%binjdb.exe" goto nojavahome

If not exist "%java_home%binjavac.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 be needed to run this program

Echo Nb:java_home should 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 be needed to run this program

Goto exit

: Gotbasedir

If exist "? Sedir%binsetclasspath.bat "Goto Okbasedir

echo the BASEDIR environment variable is not defined correctly

echo this environment variable be 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 this there are no quotes as we do not want to introduce random

REM quotes into the CLASSPATH

If not exist "%java_home%bintools.jar" goto Nojavac

Set Classpath=%java_home%libtools.jar

: Nojavac

REM Set standard command for invoking Java.

REM Note This is NT requires a window Name argument when using start.

REM Also note the quoting as java_home may contain spaces.

Set _runjava= "%jre_home%binjava"

Set _runjavaw= "%JRE_HOME%BINJAVAW"

Set _runjdb= "%java_home%binjdb"

Set _runjavac= "%java_home%binjavac"

Goto END

: Exit

Exit/b 1

: End

3, restart Tomcat, typing http://localhost:8080 verification, problem solving.

TOMCAT5 need jdk1.6 do support, jdk1.5 not enough.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.