I am able to run the sample tests supplied with junit (from any directory). I would think that this suggests my installation of junit is perfectly fine.
I assume, to compile a junit test, it is no different from any other java file, namely: javac fileName.java
My test file (.java and resulting .class) lives in: c:\parent\child. Obviously, in order to compile the .java file, I have a package statement on the first line: package parent.child followed by the all-important: import junit.framework.TestCase; After this, there is a public class fileName definition extends TestCase {}. The file compiles without any warnings or errors.
when I attempt (in the c:\parent\child directory where fileName exists, both the .java and .class):
java org.junit.runner.JUnitCore parent.child.fileName, I get the following: JUnit version 4.1 Could not find class: parent.child.fileName Time: 0 OK (0 tests)
Even if I drop parent.child altogether from the command, it makes no difference.
My CLASSPATH environment variable is set to: c:\parent\junit\junit-4.1.jar;c:\parent\junit;.
If I trying running with -cp c:\ or c:\parent\child or anything else, I still get the error.