title: Can't find JUnit on Mac
body: <p>So I am trying to build a project from <a href="http://loggly.com/blog/2011/11/java-code-coverage-with-cobertura-and-jenkins/" rel="nofollow">this</a> tutorial. I run ant, and get the error. The first thing I see is 
      ...error: package junit.framework does not exist
          [javac] import junit.framework.TestCase;
  The tutorial was very unspecific about the possible error. It just says I might not have JUnit installed. I'm running the most recent version of Java, which I assume comes with JUnit. So the problem becomes finding it(or at least confirming it exists) and adding that to the build file. How do I do that? </p>
  
  <p><strong>Build.xml</strong>
      </p>
  
  <pre><code>&lt;project name="cobertura.examples.basic" default="coverage" basedir="."&gt;
  
      &lt;description&gt;
      Cobertura - http://cobertura.sourceforge.net/
      Copyright (C) 2003 jcoverage ltd.
      Copyright (C) 2005 Mark Doliner &amp;lt;thekingant@users.sourceforge.net&amp;gt;
      Copyright (C) 2006 Dan Godfrey
      Cobertura is licensed under the GNU General Public License
      Cobertura comes with ABSOLUTELY NO WARRANTY
      &lt;/description&gt;
  
      &lt;property file="build.properties" /&gt;
  
      &lt;path id="cobertura.classpath"&gt;
          &lt;fileset dir="${cobertura.dir}"&gt;
              &lt;include name="cobertura.jar" /&gt;
              &lt;include name="lib/**/*.jar" /&gt;
          &lt;/fileset&gt;
      &lt;/path&gt;
      &lt;taskdef classpathref="cobertura.classpath" resource="tasks.properties"/&gt;
  
      &lt;target name="init"&gt;
          &lt;mkdir dir="${classes.dir}" /&gt;
          &lt;mkdir dir="${instrumented.dir}" /&gt;
          &lt;mkdir dir="${reports.xml.dir}" /&gt;
          &lt;mkdir dir="${reports.html.dir}" /&gt;
          &lt;mkdir dir="${coverage.xml.dir}" /&gt;
          &lt;mkdir dir="${coverage.summaryxml.dir}" /&gt;
          &lt;mkdir dir="${coverage.html.dir}" /&gt;
      &lt;/target&gt;
  
      &lt;target name="compile" depends="init"&gt;
          &lt;javac srcdir="${src.dir}" destdir="${classes.dir}" debug="yes"&gt;
              &lt;classpath refid="cobertura.classpath" /&gt;
          &lt;/javac&gt;
      &lt;/target&gt;
  
      &lt;target name="instrument" depends="init,compile"&gt;
          &lt;!--
              Remove the coverage data file and any old instrumentation.
          --&gt;
          &lt;delete file="cobertura.ser"/&gt;
          &lt;delete dir="${instrumented.dir}" /&gt;
  
          &lt;!--
              Instrument the application classes, writing the
              instrumented classes into ${build.instrumented.dir}.
          --&gt;
          &lt;cobertura-instrument todir="${instrumented.dir}"&gt;
              &lt;!--
                  The following line causes instrument to ignore any
                  source line containing a reference to log4j, for the
                  purposes of coverage reporting.
              --&gt;
              &lt;ignore regex="org.apache.log4j.*" /&gt;
  
              &lt;fileset dir="${classes.dir}"&gt;
                  &lt;!--
                      Instrument all the application classes, but
                      don't instrument the test classes.
                  --&gt;
                  &lt;include name="**/*.class" /&gt;
                  &lt;exclude name="**/*Test.class" /&gt;
              &lt;/fileset&gt;
          &lt;/cobertura-instrument&gt;
      &lt;/target&gt;
  
      &lt;target name="test" depends="init,compile"&gt;
          &lt;junit fork="yes" dir="${basedir}" failureProperty="test.failed"&gt;
              &lt;!--
                  Note the classpath order: instrumented classes are before the
                  original (uninstrumented) classes.  This is important.
              --&gt;
              &lt;classpath location="${instrumented.dir}" /&gt;
              &lt;classpath location="${classes.dir}" /&gt;
  
              &lt;!--
                  The instrumented classes reference classes used by the
                  Cobertura runtime, so Cobertura and its dependencies
                  must be on your classpath.
              --&gt;
              &lt;classpath refid="cobertura.classpath" /&gt;
  
              &lt;formatter type="xml" /&gt;
              &lt;test name="${testcase}" todir="${reports.xml.dir}" if="testcase" /&gt;
              &lt;batchtest todir="${reports.xml.dir}" unless="testcase"&gt;
                  &lt;fileset dir="${src.dir}"&gt;
                      &lt;include name="**/*Test.java" /&gt;
                  &lt;/fileset&gt;
              &lt;/batchtest&gt;
          &lt;/junit&gt;
  
          &lt;junitreport todir="${reports.xml.dir}"&gt;
              &lt;fileset dir="${reports.xml.dir}"&gt;
                  &lt;include name="TEST-*.xml" /&gt;
              &lt;/fileset&gt;
              &lt;report format="frames" todir="${reports.html.dir}" /&gt;
          &lt;/junitreport&gt;
      &lt;/target&gt;
  
      &lt;target name="coverage-check"&gt;
          &lt;cobertura-check branchrate="34" totallinerate="100" /&gt;
      &lt;/target&gt;
  
      &lt;target name="coverage-report"&gt;
          &lt;!--
              Generate an XML file containing the coverage data using
              the "srcdir" attribute.
          --&gt;
          &lt;cobertura-report srcdir="${src.dir}" destdir="${coverage.xml.dir}" format="xml" /&gt;
      &lt;/target&gt;
  
      &lt;target name="summary-coverage-report"&gt;
          &lt;!--
              Generate an summary XML file containing the coverage data using
              the "srcdir" attribute.
          --&gt;
          &lt;cobertura-report srcdir="${src.dir}" destdir="${coverage.summaryxml.dir}" format="summaryXml" /&gt;
      &lt;/target&gt;
  
      &lt;target name="alternate-coverage-report"&gt;
          &lt;!--
              Generate a series of HTML files containing the coverage
              data in a user-readable form using nested source filesets.
          --&gt;
          &lt;cobertura-report destdir="${coverage.html.dir}"&gt;
              &lt;fileset dir="${src.dir}"&gt;
                  &lt;include name="**/*.java"/&gt;
              &lt;/fileset&gt;
          &lt;/cobertura-report&gt;
      &lt;/target&gt;
  
      &lt;target name="clean" description="Remove all files created by the build/test process."&gt;
          &lt;delete dir="${classes.dir}" /&gt;
          &lt;delete dir="${instrumented.dir}" /&gt;
          &lt;delete dir="${reports.dir}" /&gt;
          &lt;delete file="cobertura.log" /&gt;
          &lt;delete file="cobertura.ser" /&gt;
      &lt;/target&gt;
  
      &lt;target name="coverage" depends="compile,instrument,test,coverage-report,summary-coverage-report,alternate-coverage-report" description="Compile, instrument ourself, run the tests and generate JUnit and coverage reports."/&gt;
  
  &lt;/project&gt;
  </code></pre>