• 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

How to set up JUnit on Mac OS X?

 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How can I set up JUnit on MAC OS X. When I followed the instructions that I found, I always get:

Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/runner/JUnitCore

How can I do that step by step?

Thanks.
 
author and iconoclast
Posts: 24203
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't have to do anything at all to set it up; you just have to include the jar file on the classpath whenever you compile or run your tests. Exactly how to do this depends on how you're working: at the command line, with Ant, in Eclipse, in XCode, in NetBeans... there are many possibilities!
 
Abder-Rahman Ali
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ernest Friedman-Hill wrote:You don't have to do anything at all to set it up; you just have to include the jar file on the classpath whenever you compile or run your tests. Exactly how to do this depends on how you're working: at the command line, with Ant, in Eclipse, in XCode, in NetBeans... there are many possibilities!



How can I do it on the command line?

Can you please provide me with instructions since I'm new to MAC OS X?

Thanks.
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Abder-Rahman Ali wrote:

Ernest Friedman-Hill wrote:You don't have to do anything at all to set it up; you just have to include the jar file on the classpath whenever you compile or run your tests. Exactly how to do this depends on how you're working: at the command line, with Ant, in Eclipse, in XCode, in NetBeans... there are many possibilities!



How can I do it on the command line?

Can you please provide me with instructions since I'm new to MAC OS X?

Thanks.



Did you ever figure out how to do it on the command line/terminal? I am trying to figure this out. Thanks!
 
Sheriff
Posts: 67591
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any tutorial on compiling from the command line will cover this.
 
author & internet detective
Posts: 40747
827
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Running from the command line requires one extra piece of ingo - the name of tne runner to use. See the Junit faq
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think its been ages since this has been posted. Anyways the issue might be that you need to check your classpath. I think you are using a command like




Instead if you can explicitly specify the classpath as shown below then it solves the NoClassDefFoundError exception.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic