Skip to content

Download and Install

dsaff edited this page Jan 3, 2013 · 35 revisions

To download and install JUnit you currently have the following options.

Plain-old JAR

Download one of the following JARs:

  • junit.jar: Includes the Hamcrest classes. The simple all-in-one solution to get started quickly.
  • junit-dep.jar: Only includes the JUnit classes but not Hamcrest. Lets you use a different Hamcrest version.

To use one of those JARs simply put them on your test classpath.

Maven

Add a dependency to junit:junit in test scope. (Note: 4.11 was the latest version as of the latest edit on this page. It may now be stale.)

<dependency>
  <groupId>junit</groupId>
  <artifactId>junit</artifactId>
  <version>4.11</version>
  <scope>test</scope>
</dependency>