Error:NB:JAVA_HOME should point to a jdk, not a JRE when installing Idel JDK

Source: Internet
Author: User

The workaround is To:

First check the Environment:

Run in cmd

Input Javac and Java command OK

Enter the If not exist "%java_home%\bin\java.exe" echo "%java_home%\bin\java.exe" return result: "C:\Program files\java\bin\java.exe" There is no semicolon, indicating that the environment is configured correctly that should be the problem of tomcat, on the internet to find several ways: one: in the Catalina.bat
Add a row after set current_dir=%cd%
Set Java_home=c:\program files\java\jdk1.6.0_13 (varies from person to Person)
Write your current JDK directory to death and run successfully, so you can save Tomcat from looking for it. This method is actually very savage, but it is better than no way. Questions about Tomcat not booting (nb:java_home should point to a JDK not a JRE)

There was a problem with the TOMCAT6 boot on the virtual machine today: the command window flashes and Disappears.

Run startup.bat inside cmd to get

The JAVA_HOME environment variable is not defined correctly

This environment variable are needed to run

Nb:java_home should point to a JDK not a JRE

Meaning that java_home should point to the jdk, not the Jre.

First check the Environment:

Run in cmd

Input Javac and Java command OK

Enter the If not exist "%java_home%\bin\java.exe" echo "%java_home%\bin\java.exe" return result: "C:\Program files\java\bin\java.exe" There is no semicolon, indicating that the environment is configured correctly that should be the problem of tomcat, on the internet to find several ways: one: in the Catalina.bat
Add a row after set current_dir=%cd%
Set Java_home=c:\program files\java\jdk1.6.0_13 (varies from person to Person)
Write your current JDK directory to death and run successfully, so you can save Tomcat from looking for it. This method is actually very savage, but it is better than no way. Test unsuccessful Two: The Setclasspath.bat header defines the values 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
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

......................................................................................................................... ................ Test not successful

Three: the way to solve my problem:

Edit the Startup.bat file in @echo off
if "%os%" = = "windows_nt" setlocal after adding a sentence:
Java-jar-duser.dir= "d:tomcat_6.0.14" "d:tomcat_6.0.14\bin\bootstrap.jar" Start
save, run startup.bat, Get it Done. This method seems to be the most violent method ...  Specify your tomcat path directly and start the service directly ... Test success

Other strange questions about Tomcat start-up (online Search):

A.tomcat cannot start from start, but can be started in Startup.bat

JDK version too low

B. When you start, the prompt interface for loading information disappears for a few seconds on the screen, and the Tomcat application automatically shuts down

At the end of the server.xml,/host, what should be written: content

There are some displays when the C.tomcat is started, but it is still automatically turned off and cannot be started.

It may be that the address is occupied, run the "close tomcat" shortcut on the desktop, and then start Tomcat after the execution is Complete. The d.tomcat starts flashing and cannot be started.

It is possible that the port is occupied and you can find the Server.xml file under the Tomcat installation directory, such as: \eam2003\conf\server. XML, Open this file in notepad, look for 8080, and if found, change 8080 to 8088.

E.tomcat can start normally, visible to the login interface, but not logged into the system

May be a setup problem with ie, to restore all settings to the default settings, turn off the "internet assistant" or other IE plug-in "blocking pop-up windows" Function.

At last:

Interpreting Startup.bat Files

@echo Off//dos When you run a batch, each command in the batch is executed sequentially, and it is displayed on the monitor, and you can add an "echo off" if you do not want them to appear. of course, "echo off" is also a command, which itself will also show, if not even this bar is displayed, just add "@" in Front.

if "%os%" = = "windows_nt" Setlocal//determine If the current system is a window system

Rem---------------------------------------------------------------------------//rem is a note (hereinafter)

rem Start script for the CATALINA Server

Rem

REM $Id: startup.bat 302918 2004-05-27 18:25:11z Yoavs $

rem---------------------------------------------------------------------------

REM Guess catalina_home if not defined

Set current_dir=%cd%//setting the current directory

If not "%catalina_home%" = = "goto gothome//if The catalina_home environment variable is set, go directly to the gothome below

Set catalina_home=%current_dir%//if Catalina_home is not set, the Catalina_home is the current directory (in fact, Here she assumes you enter the Tomcat installation Directory)

If exist "%catalina_home%\bin\catalina.bat" goto okhome//to Determine whether Catalina.bat found, found it directly to the following Gothome place

Cd.. Here he is assuming that you have already entered the Tomcat bin directory, so go back to the top level directory

Set Catalina_home=%cd%//now sets the installation directory Catalina_home for Tomcat

Cd%current_dir%//here is the current directory into DOS

: Gothome

If exist "%catalina_home%\bin\catalina.bat" goto Okhome//again to determine whether Catalina.bat found, found the direct to the following okhome, no, you can only prompt you!

echo the CATALINA_HOME environment variable is not defined correctly

echo this environment variable are needed to run

Goto END

: Okhome

Set executable=%catalina_home%\bin\catalina.bat//sets the file to be executed

REM Check that target executable exists

If exist "%executable%" goto Okexec//again to determine whether Catalina.bat found, found the direct to the following okexec, no words, on the Prompt.

Echo Cannot find%executable%

echo this file was needed to run

Goto END

: okexec

REM Get remaining unshifted command line arguments and save them in the

Set Cmd_line_args=//here is the setup parameter

: Setargs

If ""%1 "" = = "" "goto donesetargs//determine If the parameter is completed

Set Cmd_line_args=%cmd_line_args%%1//make a row of parameters, followed by

Shift

Goto Setargs

:d Onesetargs

Call "%executable%" Start%cmd_line_args%//execute catalina.bat, preferably change this line to: echo "%executable%" start%cmd_line_args% for reading, understanding The role of this document

Error:NB:JAVA_HOME should point to a jdk, not a JRE when installing Idel JDK

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.