Tomcat start Startup.bat a flashing problem handling method

Source: Internet
Author: User

When Tomcat starts, it reads information about the environment variables, requires a catalina_home and java_home information, catalina_home the home directory of Tomcat, java_home the home directory of the JAVA installation, and the JDK's home directory.
First, to configure java_home at the environment variable, note that the value of the variable is the JDK's home directory, not the bin directory, and do not add semicolons.


Then, if this is configured, Startup.bat still a flash, you can right click on Startup.bat, edit, in the text of the last hit pause, save after re-run Startup.bat, this time the window will not be a flash, but stay on the desktop (debugging success, the pause can be removed).

If there is an error message, this time will be displayed, can be based on its error, the Internet search for the corresponding solution, the following is the error prompt window encountered problems:
One, neither the java_home nor the JRE_HOME environment variable is defined
Tomcat's Startup.bat, which calls Catalina.bat, and Catalina.bat calls Setclasspath.bat, as long as the environment variable is declared at the beginning of the Setclasspath.bat (two line paths set below) As a result, the environment variable java_home,jre_home will not be automatically enlisted later than the new version is installed.
Add the following two lines of content to the beginning of Setclasspath.bat, as follows:
REM---------------------------------------------------------------------------
REM Set CLASSPATH and Java options
Rem
REM $Id: Setclasspath.bat 509,933-month-day 01:00:00z Jfclere $
REM---------------------------------------------------------------------------

Set Java_home=c:\program files\java\jdk1.6.0_20
Set Jre_home=c:\program Files\java\jre6

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

This automatically registers the Java_home,jre_home every time Startup.bat is run.
Run Startup.bat, prompt "message: Server startup in xxxxx MS" OK.
Twocannot find "" d:\apache-tomcat-6.0.32 "\bin\setclasspath.bat"
This time, maybe the value of Catalina_home was written somewhere in the dead, like my green version of Tomcat in the bin file more than a SetEnv.bat file, open a look is really in here is written dead Catalina_home path, This should be for some reason after being added to the settings file, after the deletion of this file, Tomcat can run normally.

In this case, you can look at the configuration in the Catalina.bat, for example, the content that may be configured to die is in this file.

Tomcat start Startup.bat a flashing problem handling method

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.