Return-Path: Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 16991 invoked from network); 3 Jun 2000 07:32:38 -0000 Received: from darius.concentric.net (207.155.198.79) by locus.apache.org with SMTP; 3 Jun 2000 07:32:38 -0000 Received: from mcfeely.concentric.net (mcfeely.concentric.net [207.155.198.83]) by darius.concentric.net (8.9.1a/(98/12/15 5.12)) id DAA29302; Sat, 3 Jun 2000 03:32:12 -0400 (EDT) [1-800-745-2747 The Concentric Network] Errors-To: Received: from INSPIRON_NT.concentric.net (ts044d17.sjc-ca.concentric.net [206.173.230.173]) by mcfeely.concentric.net (8.9.1a) id DAA12878; Sat, 3 Jun 2000 03:32:10 -0400 (EDT) Message-Id: <4.3.0.20000602230325.00b0d820@mail.concentric.net> X-Sender: willyumb@mail.concentric.net X-Mailer: QUALCOMM Windows Eudora Version 4.3 Date: Sat, 03 Jun 2000 00:32:16 -0700 To: tomcat-user@jakarta.apache.org From: William Bryant Subject: Problem found with tomcat.bat on WinNT (with solution) Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N I know, it serves me right for using NT, but I needed a portable demo machine and thought I'd test drive Tomcat, too. I do have a RH Linux/Apache/JServ/Cocoon development box that might have qualified as a luggable back in 1982. If I'm the twentieth person this week to point out this particular problem, I apologize in advance. It's hard to believe that this isn't a documented problem, but I didn't see anything relevant in the FAQ-o-matic. I'm using NT 4.0 SP4 and Sun JDK 1.1.8, my environment variables (path, classpath, tomcat_home) were all set using NT's System control panel. Anyway, having forgotten how pathetic NT is for such endeavors, I started to install Apache and Jakarta on a Pentium laptop. Apache went in fine and I could even run Tomcat with Apache, but in Tomcat's standalone mode the batch files would croak, giving me the ever-popular "java usage" message. I traced down the problem to the tomcat.bat file. The lines that invoke java, such as: java %TOMCAT_OPTS% -Dtomcat.home="%TOMCAT_HOME%" org.apache.tomcat.startup.Tomcat %2 %3 %4 %5 %6 %7 %8 %9 have extraneous quotation marks around %TOMCAT_HOME%. Once I removed those on lines 61, 67, 73, 81, and 87 the batch files worked fine. I'd be very surprised if it didn't cause similar problems in Win9x as well. Two other minor changes I made include removing a duplicate 'goto cleanup' on line 75 and changing the remark 'rem Run ant' on line 85 to 'rem Run jspc'. The fruits of my labor -- such as they are -- appear below. At the risk of getting drafted into the repair effort, I will also note that the Minimalistic User Guide appears to be slightly out of synch with the binary distribution (unzips to ./jakarta-tomcat not ./tomcat, etc.) I look forward to upgrading to Jakarta on my real machine in the near future and appreciate the great work done by all the Apache project teams. -- Willy ******** revised tomcat.bat file ********* @echo off rem A batch file to start/stop tomcat server. rem This batch file written and tested under Windows NT rem Improvements to this file are welcome rem Guess TOMCAT_HOME if it is not present if not "%TOMCAT_HOME%" == "" goto gothome SET TOMCAT_HOME=. if exist %TOMCAT_HOME%\bin\tomcat.bat goto gothome SET TOMCAT_HOME=.. if exist %TOMCAT_HOME%\bin\tomcat.bat goto gothome SET TOMCAT_HOME= echo Unable to determine the value of TOMCAT_HOME. goto eof :gothome rem Set up the CLASSPATH that we need set cp=%CLASSPATH% set CLASSPATH=. set CLASSPATH=%TOMCAT_HOME%\classes set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\webserver.jar set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jasper.jar set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xml.jar set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jar set CLASSPATH=%CLASSPATH%;%JAVA_HOME%\lib\tools.jar if "%cp%" == "" goto next rem else set CLASSPATH=%CLASSPATH%;%cp% :next if "%1" == "start" goto startServer if "%1" == "stop" goto stopServer if "%1" == "run" goto runServer if "%1" == "env" goto setupEnv if "%1" == "ant" goto runAnt if "%1" == "jspc" goto runJspc echo Usage: echo tomcat (start^|run^|env^|stop) echo start - start tomcat in a separate window echo run - start tomcat in the current window echo env - setup the environment for tomcat echo stop - stop tomcat echo ant - run ant with tomcat context echo jspc - run jsp pre compiler goto cleanup :startServer echo Starting tomcat in new window echo Using classpath: %CLASSPATH% start java %TOMCAT_OPTS% -Dtomcat.home=%TOMCAT_HOME% org.apache.tomcat.startup.Tomcat %2 %3 %4 %5 %6 %7 %8 %9 goto cleanup :runServer rem Start the Tomcat Server echo Using classpath: %CLASSPATH% java %TOMCAT_OPTS% -Dtomcat.home=%TOMCAT_HOME% org.apache.tomcat.startup.Tomcat %2 %3 %4 %5 %6 %7 %8 %9 goto cleanup :stopServer rem Stop the Tomcat Server echo Using classpath: %CLASSPATH% java %TOMCAT_OPTS% -Dtomcat.home=%TOMCAT_HOME% org.apache.tomcat.startup.Tomcat -stop %2 %3 %4 %5 %6 %7 %8 %9 goto cleanup :runAnt rem Run ant set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\ant.jar echo Using classpath: %CLASSPATH% java %ANT_OPTS% -Dant.home=%TOMCAT_HOME% -Dtomcat.home=%TOMCAT_HOME% org.apache.tools.ant.Main %2 %3 %4 %5 %6 %7 %8 %9 goto cleanup :runJspc rem Run jspc echo Using classpath: %CLASSPATH% java %JSPC_OPTS% -Dtomcat.home=%TOMCAT_HOME% org.apache.jasper.JspC %2 %3 %4 %5 %6 %7 %8 %9 goto cleanup :setupEnv set cp=%CLASSPATH% :cleanup rem clean up set CLASSPATH=%cp% set port= set host= set test= set jsdkJars= set jspJars= set beanJars= set miscJars= set appJars= set appClassPath= set cp= rem pause :eof