Eclipse - JUnit - Installation

It's time for you to play with Unit testing, especially with JUnit.

OK, let's see how to install it on Eclipse.

First of all, you need a version of JUnit.
Let's go on the official website to download it: http://www.junit.org/

In the last version, for our example, the junit4.10 one.

Open the .zip. Inside there is a junit-4.10.jar file.

In Eclipse, select a project then > Project > Properties > Java Build Path > Libraries tab > Add Jars > Select the junit-4.10.jar > OK

JUnit is ready to be used!

Let's continue this tutorial with a classic JUnit Hello World!

Comments

Comment: 

hey man, I think Eclipse already comes with JUnit support, we need to add jar file when running test cases outside eclipse using ant or hudson.

Comment: 

Hello Sandeep,

I think it depends on your Eclipse version.
Anyway thank you for your comment. cool

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.