For anyone who is interested, the solution I found to this problem is to add
the junit.jar and tools.jar(from the java jdk) to Global Entries on the
classpath tab in Eclipse's Window->Preferences->Ant->Runtime, rather than to
Ant Home Entries. The Eclipse ant editor will still give you a warning that
the class can't be found, but it runs just fine. That's the solution I
found, anyhow. If anyone knows a better way, please fill me in.
Chau for now...
-----Original Message-----
From: Jan.Materne@(protected) [mailto:Jan.Materne@(protected)]
Sent: Friday, June 03, 2005 12:07 AM
To: user@(protected)
Subject: AW: taskdef can't find junit.framework.Test
To really ensure that JUnit is on Ant's classpath, you could print it out
<echo>classpath: ${java.class.path}</echo>
But putting junit.jar into ${user.home}/.ant/lib should help.
Or starting Ant with
-lib <directory of junit.jar>
Jan
> -----Urspr?ngliche Nachricht-----
> Von: Hyrum [mailto:hyrum@(protected)]
> Gesendet am: Freitag, 3. Juni 2005 01:16
> An: user@(protected)
> Betreff: taskdef can't find junit.framework.Test
>
> Hello all.
>
>
>
> I am using the Eclipse 3.1 IDE, am on windows 2000, and am using
> ant-1.6.2(built into eclipse).
>
>
>
> My build fails with the following error:
>
>
>
> BUILD FAILED:
> C:/eclipse/workspace/CactusTestTest/build.xml:34: taskdef A
> class needed by class
> org.apache.cactus.integration.ant.CactusTask cannot be
> found: junit/framework/Test
>
>
>
> I have checked and double checked, and that class is definitely on the
> classpath. As far as I can see, it should be available. I have tried
> adding it to Eclipse's Ant->Runtime->Classpath settings, and
> to Ant's home
> lib directory, with no success. I've also tried adding
> manual entries for
> each tasks, to which it always fails on the "cactus" taskdef,
> with the same
> above error.
>
>
>
> Any ideas?
>
>
>
> ------------------------------------------------
>
>
>
> <?xml version="1.0"?>
>
> <project name="CactusTestTest" default="make-war-with-cacti"
> basedir=".">
>
>
>
> <property file="${basedir}/build.properties"/>
>
>
>
> <property name="application.name" value="
> CactusTestTest "/>
>
> <property name="servlet.jar"
> value="${tomcat.home}/common/lib/servlet-api.jar"/>
>
> <property name="jsp.jar"
> value="${tomcat.home}/common/lib/jsp-api.jar"/>
>
> <property name="deploy.dir"
> value="${tomcat.home}/webapps"/>
>
> <property name="build.compiler" value="modern"/>
>
> <property name="build.dir"
> value="${basedir}/WEB-INF/classes"
> />
>
> <property name="jspbuild.dir"
> value="./jspclasses" />
>
> <property name="webinf.dir"
> value="WebRoot/WEB-INF" />
>
> <property name="classes.dir"
> value="${webinf.dir}/classes" />
>
> <property name="lib.dir"
> value="${webinf.dir}/lib" />
>
> <property name="src.dir"
> value="${basedir}/src" />
>
>
>
> <path id="cactus.classpath" >
>
> <fileset dir="${lib.dir}">
>
> <include name="*.jar"/>
>
> </fileset>
>
> </path>
>
>
>
> <target name="init" >
>
> <echo message="Starting the Test to Test the
> CactusTestTest" />
>
>
>
> <!--
>
> <taskdef name="cactifywar"
> classname="org.apache.cactus.integration.ant.CactifyWarTask"
>
> classpathref="cactus.classpath" />
>
> <taskdef name="cactus"
> classname="org.apache.cactus.integration.ant.CactusTask"
>
> classpathref="cactus.classpath" />
>
> -->
>
>
>
> <taskdef resource="cactus.tasks"
> classpathref="cactus.classpath" />
>
> </target>
>
>
>
> <target name="make-war-with-cacti" depends="init" >
>
> <cactifywar />
>
> </target>
>
>
>
>
>
> </project>
>
>
the junit.jar and tools.jar(from the java jdk) to Global Entries on the
classpath tab in Eclipse's Window->Preferences->Ant->Runtime, rather than to
Ant Home Entries. The Eclipse ant editor will still give you a warning that
the class can't be found, but it runs just fine. That's the solution I
found, anyhow. If anyone knows a better way, please fill me in.
Chau for now...
-----Original Message-----
From: Jan.Materne@(protected) [mailto:Jan.Materne@(protected)]
Sent: Friday, June 03, 2005 12:07 AM
To: user@(protected)
Subject: AW: taskdef can't find junit.framework.Test
To really ensure that JUnit is on Ant's classpath, you could print it out
<echo>classpath: ${java.class.path}</echo>
But putting junit.jar into ${user.home}/.ant/lib should help.
Or starting Ant with
-lib <directory of junit.jar>
Jan
> -----Urspr?ngliche Nachricht-----
> Von: Hyrum [mailto:hyrum@(protected)]
> Gesendet am: Freitag, 3. Juni 2005 01:16
> An: user@(protected)
> Betreff: taskdef can't find junit.framework.Test
>
> Hello all.
>
>
>
> I am using the Eclipse 3.1 IDE, am on windows 2000, and am using
> ant-1.6.2(built into eclipse).
>
>
>
> My build fails with the following error:
>
>
>
> BUILD FAILED:
> C:/eclipse/workspace/CactusTestTest/build.xml:34: taskdef A
> class needed by class
> org.apache.cactus.integration.ant.CactusTask cannot be
> found: junit/framework/Test
>
>
>
> I have checked and double checked, and that class is definitely on the
> classpath. As far as I can see, it should be available. I have tried
> adding it to Eclipse's Ant->Runtime->Classpath settings, and
> to Ant's home
> lib directory, with no success. I've also tried adding
> manual entries for
> each tasks, to which it always fails on the "cactus" taskdef,
> with the same
> above error.
>
>
>
> Any ideas?
>
>
>
> ------------------------------------------------
>
>
>
> <?xml version="1.0"?>
>
> <project name="CactusTestTest" default="make-war-with-cacti"
> basedir=".">
>
>
>
> <property file="${basedir}/build.properties"/>
>
>
>
> <property name="application.name" value="
> CactusTestTest "/>
>
> <property name="servlet.jar"
> value="${tomcat.home}/common/lib/servlet-api.jar"/>
>
> <property name="jsp.jar"
> value="${tomcat.home}/common/lib/jsp-api.jar"/>
>
> <property name="deploy.dir"
> value="${tomcat.home}/webapps"/>
>
> <property name="build.compiler" value="modern"/>
>
> <property name="build.dir"
> value="${basedir}/WEB-INF/classes"
> />
>
> <property name="jspbuild.dir"
> value="./jspclasses" />
>
> <property name="webinf.dir"
> value="WebRoot/WEB-INF" />
>
> <property name="classes.dir"
> value="${webinf.dir}/classes" />
>
> <property name="lib.dir"
> value="${webinf.dir}/lib" />
>
> <property name="src.dir"
> value="${basedir}/src" />
>
>
>
> <path id="cactus.classpath" >
>
> <fileset dir="${lib.dir}">
>
> <include name="*.jar"/>
>
> </fileset>
>
> </path>
>
>
>
> <target name="init" >
>
> <echo message="Starting the Test to Test the
> CactusTestTest" />
>
>
>
> <!--
>
> <taskdef name="cactifywar"
> classname="org.apache.cactus.integration.ant.CactifyWarTask"
>
> classpathref="cactus.classpath" />
>
> <taskdef name="cactus"
> classname="org.apache.cactus.integration.ant.CactusTask"
>
> classpathref="cactus.classpath" />
>
> -->
>
>
>
> <taskdef resource="cactus.tasks"
> classpathref="cactus.classpath" />
>
> </target>
>
>
>
> <target name="make-war-with-cacti" depends="init" >
>
> <cactifywar />
>
> </target>
>
>
>
>
>
> </project>
>
>