You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Senor Simpatico <cg...@yahoo.com> on 2001/04/25 18:44:36 UTC

classpath error in 3.2.1 sample build.bat

Hi all --

Being fairly new to Java in general and knowing
nothing about Tomcat or servlet programming, this gave
me all kinds of grief when I first downloaded Tomcat a
couple weeks ago.  Perhaps this has been pointed out
previously, but I couldn't find anything on the user
archives that answered the question.

The file doc\appdev\sample\build.bat begins as
follows:
@echo off
rem build.bat -- Build Script for the "Hello, World"
Application
rem $Id: build.bat,v 1.3.2.2 2000/11/27 22:45:57
craigmcc Exp $

set _CP=%CP%

rem Identify the custom class path components we need
set
CP=%TOMCAT_HOME%\lib\ant.jar;%TOMCAT_HOME%\lib\servlet.jar
set
CP=%TOMCAT_HOME%\lib\jaxp.jar;%TOMCAT_HOME%\lib\parser.jar
set CP=%CP%;%JAVA_HOME%\lib\tools.jar

[remainder deleted]

The first set CP=... line sets CP to include ant.jar
and servlet.jar, but this is then overwritten in the
second line!  The second line should be written in the
same manner as the third:
set CP=%CP%;\%TOMCAT_HOME%\lib\jaxp.jar;%TOMCAT_HOME%

Otherwise, you get this error when you try to build
the webapp:
Exception in thread "main"
java.lang.NoClassDefFoundError: org/apache/tools/ant/
Main

I realize most people on this list are probably using
linux, not Windows, so haven't run into this problem
in build.bat, but I'm sure I'm not the only one
running Tomcat on Windows.  I find it hard to
understand why no one has complained about this before
and why it hasn't been fixed.  This is a "release
build," after all, so it would be helpful if the
sample application scripts actually worked... :)

Chris



__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/