File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes ANT classpath Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "ANT classpath" Watch "ANT classpath" New topic

ANT classpath

Eshwin Sukhdeve
Ranch Hand

Joined: Mar 15, 2012
Posts: 90
I have project folder.

inside java folder some java files are there.and inside classes folder all the class files exist.(this class files genereted from java folder java files)

now inside testscript one java file is there..I have to compile this class using ANT.but in this class I am using some classes which is inside java folder.
so when I am compiling the the testscript java file it is sayinh package does not exixt.because these package is refering to java this is
class path can someone tell me how to metion classpath for other package

here is my build.xml file

<?xml version="1.0" encoding="UTF-8"?>
<project name="sonnetframwwork1"
xmlns:vss="antlibrg.apache.ant.vss" basedir=".">
<!--this file was created by Eclipse Runnable JAR Export Wizard-->
<!--ANT 1.7 is required
<property name="build_dir" value="D:/Project13/sonnetframwwork1/classes"/>
<property name="testdata" location="D:/Project13/sonnetframwwork1/testdata"/>

<path id="project.classpath">
<fileset dir="D:\Project13\sonnetframwwork1\references">
<include name="*.jar"/>
<fileset dir="${build_dir}">
<include name="*.class"/>
<fileset dir="testdata">
<fileset dir="D:\Project13\sonnetframwwork1\testscripts">
<target name="create">
<mkdir dir="D:\Project13\sonnetframwwork1\classes"/>
<mkdir dir="D:\Project13\sonnetframwwork1\jar"/>
<target name="compile">
<javac destdir="D:\Project13\sonnetframwwork1\classes" debug="true" srcdir="D:\Project13\sonnetframwwork1\java">
<classpath refid="project.classpath"/>
<target name="compile1" depends="compile,jar">
<javac srcdir="D:\Project13\sonnetframwwork1\testscripts" destdir="D:\Project13\sonnetframwwork1\testscripts"
<target name="jar" depends="compile">
<jar destfile="D:\Project13\sonnetframwwork1\jar\SahiProject.jar"
<target name="run">
<java classname="TestExecute" classpath="${build_dir}"/>

I am getting this problem when i say "Ant compile1"

I agree. Here's the link:
subject: ANT classpath
It's not a secret anymore!