Hello
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
- A.java
- forms
- B.java
- build.xml
- lib
The first two lines of classes\forms\B.java 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
Software.......
If I run javac from the command line, with directory set to "classes" it is
fine.
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>
<target name="compile" depends="delete">
<javac srcdir="base" destdir="." />
<javac srcdir="forms" destdir="." />
</target>
<target name="jar" depends="compile">
<jar basedir="." destfile="../lib/${jarfile}" includes="**/*.class" />
</target>
</project>
Regards
Andrew Connick
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]