title: Unable to run junit test from command prompt
body: <p>I'm trying to run a JUnit test case from command line<Br>The code I followed is set to bin dir</p>
  
  <pre><code>c:/eclipse/workspace/sample/bin&gt; java -cp C:\Ram Doc\eclipse\plugins\org.junit_4.8.2.v4_8_2_v20110321-1705.junit.jar C:\Ram Doc\eclipse\workspace\Script_Bvt\bin org.junit.runner.JUnitCore login_sanity(That's my class Name)
  </code></pre>
  
  <p>Error message is</p>
  
  <pre><code>C:\Ram Doc\eclipse\workspace\Script_Bvt\bin&gt;java -cp C:\Ram Doc\eclipse\plugins\
  org.junit_4.8.2.v4_8_2_v20110321-1705.junit.jar java org.junit.runner.JUnitCore
  login_sanity
  Exception in thread "main" java.lang.NoClassDefFoundError: Doc\eclipse\plugins\o
  rg/junit_4/8/2/v4_8_2_v20110321-1705/junit/jar
  Caused by: java.lang.ClassNotFoundException: Doc\eclipse\plugins\org.junit_4.8.2
  .v4_8_2_v20110321-1705.junit.jar
      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:306)
      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
  Could not find the main class: Doc\eclipse\plugins\org.junit_4.8.2.v4_8_2_v20110
  321-1705.junit.jar.  Program will exit.
  </code></pre>
  
  <p>If i keep the <code>login_sanity</code> at other location and execute:</p>
  
  <pre><code>C:\Selenium&gt;javac -cp "C:\Selenium\junit4.10\junit4.10\junit-4.10.jar;." org.junit.runner.JUnitCore login_sanity
  </code></pre>
  
  <p>I get the following error:</p>
  
  <pre><code>Class names, 'org.junit.runner.JUnitCore,login_sanity', are only accepted if 
  annotation processing is explicitly requested
  </code></pre>
  
  <p>The following shows my complete steps:
  <img src="https://i.stack.imgur.com/rRmR1.png" alt="enter image description here"></p>