• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Junit compile problem

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 3061
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
reply
    Bookmark Topic Watch Topic
  • New Topic