ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Connick" <>
Subject Problems understanding classpath and package
Date Sat, 29 Dec 2007 17:39:24 GMT

I am fairly new to Ant. I am trying to use it to compile java, but I am
having problems with 'package does not exist' I assume it's a classpath
issue. Although I can find plenty of advice on how to set the classpath, I
cannot understand what it should be.

My directory structure is something like
-  classes
  - base
  - forms
  - build.xml
- lib

The first two lines of classes\forms\ are:
package tags;
import base.*;

When I try to compile this with Ant, I get 'package does not exist'. My
understanding of the documentation is that I should not need any classpath
because it's the basedir. Also, if I run "ant -verbose" I see the following:
    [javac] '-classpath'
    [javac] 'C:\My Web Sites\CMS\V2\WEB-INF\classes;C:\Program Files\Apache

If  I run javac from the command line, with directory set to "classes" it is

My classes\build.xml is:
<project name="Compile all" default="jar" basedir=".">
 <property name="jarfile" value="cms_v2.jar" />

 <target name="delete">
  <delete><fileset dir="." includes="**/*.class"/></delete>

 <target name="compile" depends="delete">
  <javac srcdir="base" destdir="." />
  <javac srcdir="forms" destdir="." />

 <target name="jar" depends="compile">
  <jar basedir="." destfile="../lib/${jarfile}" includes="**/*.class" />


Andrew Connick

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message