Skip to content

Download and Install

rjosal edited this page Jan 18, 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. Starting with version 4.11, Hamcrest is no longer included in this jar.
  • 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>
Clone this wiki locally