• Post Reply Bookmark Topic Watch Topic
  • New Topic

Syntax of the command is incorrect msg when starting startup.bat from command line  RSS feed

Marie Griffin
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I hope someone can help me with this. I have been trying to get tomcat running for a couple of days and I cannot figure it out. I've tried starting it from the command line on windows 7 and this is what I get out:

C:\Users\mgriffin>cd C:\Tomcat_Home\bin

C:\Tomcat_Home\bin> startup.bat

C:\Tomcat_Home\bin>rem Licensed to the Apache Software Foundation (ASF) under on
e or more

C:\Tomcat_Home\bin>rem contributor license agreements. See the NOTICE file dist
ributed with

C:\Tomcat_Home\bin>rem this work for additional information regarding copyright

C:\Tomcat_Home\bin>rem The ASF licenses this file to You under the Apache Licens
e, Version 2.0

C:\Tomcat_Home\bin>rem (the "License"); you may not use this file except in comp
liance with

C:\Tomcat_Home\bin>rem the License. You may obtain a copy of the License at


C:\Tomcat_Home\bin>rem http://www.apache.org/licenses/LICENSE-2.0


C:\Tomcat_Home\bin>rem Unless required by applicable law or agreed to in writing
, software

C:\Tomcat_Home\bin>rem distributed under the License is distributed on an "AS IS

ess or implied.

C:\Tomcat_Home\bin>rem See the License for the specific language governing permi
ssions and

C:\Tomcat_Home\bin>rem limitations under the License.

C:\Tomcat_Home\bin>if "Windows_NT" == "Windows_NT" setlocal

C:\Tomcat_Home\bin>rem ---------------------------------------------------------

C:\Tomcat_Home\bin>rem Start script for the CATALINA Server


C:\Tomcat_Home\bin>rem $Id: startup.bat 908749 2010-02-10 23:26:42Z markt $

C:\Tomcat_Home\bin>rem ---------------------------------------------------------

C:\Tomcat_Home\bin>rem Guess CATALINA_HOME if not defined

C:\Tomcat_Home\bin>set "CURRENT_DIR=C:\Tomcat_Home\bin"

C:\Tomcat_Home\bin>if not "C:\Tomcat_Home" == "" goto gotHome

C:\Tomcat_Home\bin>if exist "C:\Tomcat_Home\bin\catalina.bat" goto okHome

C:\Tomcat_Home\bin>set "EXECUTABLE=C:\Tomcat_Home\bin\catalina.bat"

C:\Tomcat_Home\bin>rem Check that target executable exists

C:\Tomcat_Home\bin>if exist "C:\Tomcat_Home\bin\catalina.bat" goto okExec

C:\Tomcat_Home\bin>rem Get remaining unshifted command line arguments and save t
hem in the

C:\Tomcat_Home\bin>set CMD_LINE_ARGS=

C:\Tomcat_Home\bin>if """" == """" goto doneSetArgs

C:\Tomcat_Home\bin>call "C:\Tomcat_Home\bin\catalina.bat" start
The syntax of the command is incorrect.

My startup.bat file is as follows:

I have set my environment variables CATALINA_HOME and JAVA_HOME to point at the tomcat directory C:\Tomcat_Home and java directory C:\Program Files\Java\jre6

Stek Dobbel
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although this is an old problem, I got the same problem and here's how to troubleshoot and fix it:

Isolate the trouble by selecting your troublesome .bat file and editing so that the line ECHO OFF reads ECHO ON. Run the command. Now you have the location of the problem printed on the screen. It may be a single command or a call to another batch file (then you just switch the ECHO ON to that .bat).

With Tomcat the prolem usually lies in your environment variables. The batch files are full of references to them. Check the following:
- you might accidentally have entered an extra quote to your path, for example JAVA_HOME = C:\java\home"
- you have spaces in directories and there are no quotes around them, for example JAVA_HOME=C:\java home or %JAVA_HOME == "" in the batch file.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!