Turn: The Java_home jre_home solution was not found during Tomcat boot

Source: Internet
Author: User

Transferred from: http://blog.sina.com.cn/s/blog_61c006ea0100l1u6.html

Original:

On XP is clearly installed JDK1.5 and set up the Java_home, but Tomcat in the boot process can not find.

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 the program; hint java_home each jre_home path cannot be found, what solution?

The reason is not known, the following look at the solution:

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

2, in Setclasspath.bat's head defines the value of Java_home and Jre_home, 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 files\java\jdk1.5.0_05
Set Jre_home=c:\program files\java\jre1.5.0_05

REM Make sure prerequisite environment variables is set
If not "%java_home%" = = "goto gotjdkhome

My system environment:

My system Tips
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 are 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 should point-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 are needed to run
Echo Nb:java_home should point-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 are needed to run
Goto exit
: Gotbasedir
If exist "? Sedir%\bin\setclasspath.bat "Goto Okbasedir
echo the BASEDIR environment variable is not defined correctly
echo this environment variable are needed to run
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 is no quotes as we don't 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, typing http://localhost:8080 verification, problem solving.

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

of my own

My system environment is as follows

The difference is that when I install, Java has been upgraded to Jdk1.8.0_65,tomact using: apache-tomcat-8.0.28, the operating system uses the win 10 64-bit

I also set up the configuration of the environment variables (including Java_home JAVA_JRE and Path,classpath all the possible configurations I've been looking for online)

Run Java javac under CMD, startup.bat when running Tomcat jre_home environment variable was defined at least one of these environment Variable is needed to run

Helpless online A check, found this article, set up a good

Set Java_home=c:\program files\java\jdk1.8.0_65

Set Jre_home=c:\program Files\java\jdk1.8.0_65\jre

Run Startup.bat again:)

Turn: The Java_home jre_home solution was not found during Tomcat boot

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.