wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Junit compile problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Junit compile problem" Watch "Junit compile problem" New topic
Author

Junit compile problem

alpha philips
Greenhorn

Joined: Oct 08, 2004
Posts: 2
I set up Junit in d:\Junit, and set classpath to d:\Junit\junit.jar;d:\Junit.
then I run the following instruction:
java junit.swingui.TestRunner junit.samples.AllTests, a swing ui appears but companies with an error message:
Exception in thread "main" java.lang.NoClassDefFoundError: junit.samples.AllTests (wrong name:/Junit/samples/AllTests).......
Could anyone help me?
Stan James
(instanceof Sidekick)
Ranch Hand

Joined: Jan 29, 2003
Posts: 8791
Looks like a case mismatch in the package name - your command line has "junit" and the class has "Junit". Try upper case J in your command line. I guess the JVM found the class file with case-insensitive search but failed a case sensitive match on the classname inside the file.


A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
The problem is a little more than that. Your installation directory is D:\Junit but should be D:\junit. Remember that Java is case-sensitive, even if your operating system is not. This means that you need to be very careful when naming files and directories.

HTH

Layne


Java API Documentation
The Java Tutorial
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Junit compile problem
 
Similar Threads
junit compile problem
JUnit installation problem
junit - set classpath problem
Starting JUnit - Testcenter
JUnit newbie