The difference between Startup.bat and Tomcat7.exe in the bin directory of Tomcat

Source: Internet
Author: User
Tags goto tomcat apache tomcat

Situation: After Tomcat decompression, start the bin directory Startup.bat normal, but start tomcat7.exe but can not start, why.

First, the difference between Tomcat7.exe and Startup.bat:

1. Both of these can start Tomcat, but Tomcat7.exe must have a service installed to start, and Startup.bat does not need

2, another difference is that they start using the Java environment configuration is separate

The Java configuration used by the Tomcat7.exe startup is the same as the Java configuration used by the service startup, all through the Java panel configuration of the Tomcat7w.exe (you can modify the Java_home variable of the Service.bat file before the service is created to specify the initial JVM , all configuration items for the Java panel are initialized from the Service.bat file. The Java configuration used by the Startup.bat startup can be specified by modifying the java_home and Jre_home variables in the Catalina.bat and Setclasspath.bat files, or it can be added directly to the advanced properties of the computer.

Second, Tomcat6 decompression version of the configuration

After the download is complete, unzip to D:\TOMCAT7 (set your path), check whether the environment variable Java_home exists: General JDK installation will be set automatically, if not created, the value of Java_home is set to the JDK installation root path

1. Setting Environment variables

2. Set up service

Service Setup method, that is, to solve the above situation, edit the Service.bat file

REM Guess catalina_home if not defined set current_dir=%cd% add the following sentence to specify the installation directory for Tomcat. Set catalina_home=d:\apache-tomcat-7.0.29 if not "%catalina_home%" = = "" Goto Gothome set catalina_home=%cd% in order to be in "process" with other security The tomcat that is installed distinguishes the name and modifies the Tomcat7.exe file name.

I still use tomcat7.exe here.
If exist "%catalina_home%\bin\tomcat7.exe" goto okhome REM CD to the upper dir CD. Set catalina_home=%cd%: gothome if exist "%catalina_home%\bin\tomcat6018.exe" Goto okhome echo the tomcat.exe is not Foun
D ... echo the CATALINA_HOME environment variable is not defined correctly.  echo this environment variable was needed to run this program goto end REM Make sure prerequisite environment variables are Set if not "%java_home%" = = "" Goto okhome echo the JAVA_HOME environment variable is not defined echo this environment V Ariable is needed to run the program goto end:okhome if not "%catalina_base%" = = "" Goto gotbase Set Catalina_base=%cat Alina_home%: Gotbase set executable=%catalina_home%\bin\tomcat6018.exe rem Set default ServiCe name the service name after the service is created, this name must be unique (the name of the Tomcat7.exe,tomcat7w.exe in the extracted directory corresponds to this) set SERVICE_NAME=TOMCAT7 the service display name after the service was created,
This name can be the same as other service display names. Set Pr_displayname=apache Tomcat 7 ......

(omitted in middle) "%executable%"//us//%service_name% ++jvmoptions "-djava.io.tmpdir=%catalina_base%\temp;-d Java.util.logging.manager=org.apache.juli.classloaderlogmanager;-djava.util.logging.config.file=%catalina_base  %\conf\logging.properties "--jvmms--jvmmx 256 If you need to set the service to boot, you can add the following sentence sc config%service_name% start= Auto echo the

Service '%service_name% ' has been installed. : End CD%current_dir%

To run command-line cmd, you can view the current service with the Services.msc command only to discover that there is no Apache Tomcat 7, enter the Tomcat bin directory, perform the Service.bat install service Then using Services.msc to view the service is more than the Apache Tomcat 7 problem solved.

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.