The core pack for Tomcat startup and shutdown is%tomcat Directory%/bin/bootstrap.jar
Start: Create the Start-up.bat file with the following contents:
Java-jar Bootstrap.jar Start
Off: Create the Shup-down.bat file as follows:
Java-jar Bootstrap.jar Stop
The main method of the Org.apache.catalina.startup.Bootstrap class in Bootstrap.jar is as follows:
public static void Main (string[] args) {try {new objectname ("Test:foo=bar"); The catch (Throwable t) {System.out.println ("This release of Apache Tomcat is packaged to run" J2SE 5.0 \ n or later. It can be run on earlier JVMs by downloading and \ninstalling a compatibility package from the Apache Tomcat \nbinary do
Wnload page. ");
try {thread.sleep (5000L);
catch (Exception ex) {} return;
} if (daemon = = null) {daemon = new Bootstrap ();
try {daemon.init ();
catch (Throwable t) {t.printstacktrace ();
Return
The try {String command = "start";//default parameter is start if (Args.length > 0) {
Command = args[(args.length-1)]; } if (Command.equals ("STARTD")){Args[0] = "start";//Start Method Daemon.load (args);
Daemon.start ();
else if (command.equals ("STOPD")) {args[0] = "stop";//Closed Method Daemon.stop ();
else if (command.equals ("start")) {daemon.setawait (true);//Startup Method Daemon.load (args);
Daemon.start ();
else if (command.equals ("Stop")) {daemon.stopserver (args);//Closed method} else { Log.warn ("Bootstrap:command \" "+ Command +" \ "does not exist.");
Error command join log} catch (Throwable command) {t.printstacktrace (); }
}