Tomcat boot Startup.bat under Windows system Flash

Source: Internet
Author: User

After encountering running Startup.bat, a window flashes past the problem


When Tomcat starts, it reads information about the environment variables and needs a catalina_home and java_home information.
Catalina_home is the home directory of Tomcat, Java_home is the home directory of the JAVA installation, the main directory of the JDK.
First, to configure java_home at the environment variable, note that the value of the variable is the home directory of the JDK, 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).


The following are the problems encountered in the error prompt window:
One, neither the java_home nor the JRE_HOME environment variable is defined
Tomcat's Startup.bat, which calls the Catalina.bat, and Catalina.bat calls the Setclasspath.bat,
Just declare the environment variable at the beginning of the Setclasspath.bat (two lines in red),
The reason is that the environment variable java_home,jre_home is not automatically enlisted later when the newer version is installed.
Add a red tag section to the beginning of Setclasspath.bat, as follows:
REM---------------------------------------------------------------------------
REM Set CLASSPATH and Java options
Rem
REM $Id: Setclasspath.bat 505241 2007-02-09 10:22:58z jfclere $
REM---------------------------------------------------------------------------

Red section:
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 "info: Server startup in xxxxx MS" OK done

Second, cannot find "" d:\apache-tomcat-6.0.32 "\bin\setclasspath.bat"
At this time, it could be that the value of Catalina_home was written dead somewhere,
Like some green version of Tomcat in the bin file with a SetEnv.bat file,
Open a look as sure as it was in here was written dead Catalina_home's 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


-----------------------------------------------
Port is occupied
Press Win+x to select the command prompt (Administrator) command:
After opening the DOS window, we typically enter the "netstat" command to see the simple statistics, where the colon is followed by the port information
The PID process sequence number can be displayed in the right column when the "Netstat-nao" command is entered so that we end the program directly with a command
Enter the "Netstat-nab" command for more information on network connections, port occupancy, and program run
If you find an abnormal port and program, you can end the process tree first
-----------------------------------------------

Note: The contents of the essay are from the online data collation, for reference only.

Tomcat boot Startup.bat under Windows system Flash

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.