0

I installed jUnit using the normal NetBeans installer but when I try to open a project that uses jUnit, I get a dialog box that says I have to resolve missing references. In addition, when I tried to find the jUnit library, I noticed that it wasn't in the list of libraries.

I have already tried installing the NetBeans jUnit plugin.

What must I do to get jUnit working?

Context:

  • Windows 7 SP1 64-bit edition
  • NetBeans 7.2
ollo
  • 24,797
  • 14
  • 106
  • 155
Zian Choy
  • 2,846
  • 6
  • 33
  • 64

1 Answers1

1

Depends on the Project type you are using.

Ant:
Right click on on the Libraries folder and select Add Library....
A new window will appear where you can choose a JUnit version to add.

Maven:
Open Project Files/pom.xml. Declare a JUnit dependency like that:

<dependencies>
  <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.10</version>
    <scope>test</scope>
  </dependency>
</dependencies>
Michael
  • 46
  • 4