title: Can't get a simple JUnit4 test to run from the command line
body: <p>I have an ant build that compiles a JUnit test file file in<code>src...test</code> and copies it to <code>build/timex...com/visualpatterns/timex/test</code> (I've written the complete path name below).  But for the life of me, I can't get JUnit to run the thing.  Can anyone point me in the right direction (I've wasted hrs on this)?  My <code>CLASSPATH</code> seems to be ok (JUnit runs), but it can't find the class file...</p>
  
  <pre><code>$ echo $CLASSPATH
  **.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\Program Files\junit4.8.2\junit-4.8.2.jar;C:\Program Files\junit4.8.2**
  
  
  Me@My-PC /cygdrive/c/java/Code/Command_Line/Projects/timex
  $ **java org.junit.runner.JUnitCore**
  JUnit version 4.8.2
  
  Time: 0.001
  
  OK (0 tests)
  
  
  Me@My-PC /cygdrive/c/java/Code/Command_Line/Projects/timex
  $ **java -cp build/timex/WEB-INF/classes org.junit.runner.JUnitCore  com.visualpatterns.timex.test.SimpleTest**
  java.lang.NoClassDefFoundError: org/junit/runner/JUnitCore
  Caused by: java.lang.ClassNotFoundException: org.junit.runner.JUnitCore
          at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
          at java.security.AccessController.doPrivileged(Native Method)
          at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
          at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
  Could not find the main class: org.junit.runner.JUnitCore.  Program will exit.
  Exception in thread "main"
  </code></pre>
  
  <hr>
  
  <pre><code>/cygdrive/c/java/Code/Command_Line/Projects/timex/
  ------------------------------------------------------
  
     **build/timex/WEB-INF/classes/com/visualpatterns/timex/test/***SimpleTest.class*
  </code></pre>
  
  <p><strong>SimpleTest.java</strong></p>
  
  <pre><code>package com.visualpatterns.timex.test;
  
  import org.junit.Test;
  import static org.junit.Assert.assertTrue;
  
  public class SimpleTest
  {
  
   int value1 = 2, value2 = 3, expectedResult = 5;
  
      @Test
      public void addSuccess()
      {
          assertTrue(value1 + value2 == expectedResult);
      }
  
      @Test
      public void addFail()
      {
          assertTrue(value1 - value2 == expectedResult);
      }
  }
  </code></pre>