Win a 3 month subscription to Marco Behler Videos this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Junit compile problem  RSS feed

 
alpha philips
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Layne Lund
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!