Tomcat startup. Bat Startup Script

Source: Internet
Author: User

The main function of the startup. BAT file is to find the catali. BAT file and execute it.

@ Echo off

Rem flood -----------------------------------------------------------------------------------------------------------------------

/*

When running the batch processing, DOS will execute each command in the batch processing sequentially and display it on the monitor. If you do not want them to display it, you can add an echo off. Of course, echo off is also a command. If this command is unwilling to be displayed, add @ before echo off @

*/

Rem flood -----------------------------------------------------------------------------------------------------------------------
Rem licensed to the Apache Software Foundation (ASF) under one or more
Rem contributor license agreements. See the notice file distributed
Rem this work for additional information regarding copyright ownership.
Rem the ASF licenses this file to you under the Apache license, version 2.0
REM (the "License"); you may not use this file except T in compliance
Rem the license. You may obtain a copy of the license
Rem
Rem http://www.apache.org/licenses/LICENSE-2.0.
Rem
Rem unless required by applicable law or agreed to in writing, software
Rem distributed under the license is distributed on an "as is" basis,
REM without warranties or conditions of any kind, either express or implied.
Rem see the license for the specific language governing permissions and
Rem limitations under the license.

/*

Rem is Annotation

*/

Rem flood -----------------------------------------------------------------------------------------------------------------------

If "% OS %" = "windows_nt" setlocal

/*

Determine if the current system is Windows

*/

Rem flood -----------------------------------------------------------------------------------------------------------------------
Set "current_dir = % Cd %"

/*

Set the current directory

*/

Rem flood -----------------------------------------------------------------------------------------------------------------------


If not "% catalina_home %" = "" Goto gothome

/*

If the catalina_home environment variable is set, you can skip to the following gothome and execute

*/


Set "catalina_home = % current_dir %"

/*

If the catalina_home environment variable is not set, set the environment variable to the current directory.

*/


If exist "% catalina_home % \ bin \ Catalina. Bat" Goto okhome

/*

Check whether Catalina. bat is found. If yes, jump to okhome.

*/


CD ..

/*

Here, the system assumes that you have already entered the bin directory of Tomcat, so you will return to the upper-level directory.

*/


Set "catalina_home = % Cd %"

/*

Now, set catalina_home to the tomcat installation directory again.

*/


Cd "% current_dir %"

/*

Enter the current DoS directory

*/


: Gothome
If exist "% catalina_home % \ bin \ Catalina. Bat" Goto okhome

/*

Check whether Catalina. bat is found. If yes, jump to okhome.

*/


Echo the catalina_home environment variable is not defined correctly
Echo this environment variable is needed to run this program
Goto end

/*

If you still cannot find Catalina. bat, an error is returned.

*/


: Okhome
Set java_home = c: \ Program Files \ Java \ jdk1.5.0 _ 16/* If the local machine has started other tomcat, you can set java_home to run the second Tomcat */


Set "executable = % catalina_home % \ bin \ Catalina. Bat"/* set the file to be run */

Rem check that target executable exists


If exist "% executable %" Goto okexec

/*

Check again that Catalina. Bat exists. If yes, the system jumps to okexec for execution. Otherwise, an error message is displayed.

*/


Echo cannot find "% executable %"
Echo this file is needed to run this program
Goto end


: Okexec

 

Rem get remaining unshifted command line arguments and save them in


Set parameter _line_args = here is the set Parameter
: Setargs
If "% 1" "=" Goto donesetargs determines whether the parameter is added
Set pai_line_args = % pai_line_args % 1 // set the parameter to a row and connect it
Shift
Goto setargs
: Donesetargs

Call "% executable %" start % cmd_line_args % execute the Catalina. BAT file

: End

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.