1 Reply Latest reply: Dec 2, 2007 9:06 PM by 807600 RSS

    ant - package junit.framework does not exist

    807600
      hello everybody,

      I am getting this error : package junit.framework does not exist, when compiling with ant. What I have to do to resolve this error? I am a beginer in using ant

      thanks for your consideration
      akaliza
        • 1. Re: ant - package junit.framework does not exist
          807600
          junit.framework is a package in junit.jar. You will need this in the path that you pass to your compile step, you need something like this:
          <path id="class.path">
                    <pathelement location="${dest}" />
                    <fileset dir="${lib}" includes="*.jar" />
                    <pathelement location="${extras}/junit/junit.jar" />
               </path>
          and then you use that in your compile:
               <target name="compile" depends="init">
                    <javac classpathref="class.path" destdir="${dest}/classes" srcdir="${src}"  debug="true" />
               </target>
          of course if you want to run the tests from ant you may need to include the jar file for optional ant junit task in ant's library if its not already there.