Adriel Martinez
Adriel Martinez

Reputation: 21

Issue with org.junit.*; in Netbeans "package org.junit does not exist"

I am attempting to make a to do list and need to import org.junit. However, NetBeans will not acknowledge that this package exists. I get the error:"package org.junit does not exist". I tested importing org.xml.sax.Attributes, which worked. I'm using NetBeans 8.2 on windows 10 Version 10.0.15063 Build 15063

What I have attempted:

What else can I do in order to get Junit to work

Upvotes: 2

Views: 8812

Answers (5)

Rafael García
Rafael García

Reputation: 1

The archives of mathemagician have resolve the problem. Installing the junit 5 jar in a folder junit_5 in libraries

Upvotes: 0

mathemagician
mathemagician

Reputation: 1

i right clicked 'libraries' and then clicked 'add JAR/folder' and pointed to these JAR files which i first downloaded and saved https://jar-download.com/artifacts/org.junit.jupiter/junit-jupiter-api

Upvotes: 0

Siva lingam
Siva lingam

Reputation: 1

The above solutions did not give me the solution. BUT I came up with a simple idea which works out for me, That is LIBRARIES->RIGHT CLICK - >ADD LIBRARY - > select JUNIT -> click ADD LIBRARY. well i think this will solve your problem..

Upvotes: 0

Holmes13
Holmes13

Reputation: 46

I experienced this same issue using Netbeans 8.2. The issue seems to occur for me because I added already coded JUnit classes to my project.

To resolve the issue, I imported JUnit and Hamcrest by right clicking on my project. Then going to Project Properties -> Libraries -> Compile Tests -> Add Library and then the same for Run Tests.

Next, I added a new JUnit class to the test package. Once this was added Netbeans acknowledged that I had added JUnit.

Upvotes: 2

mpunktw
mpunktw

Reputation: 267

Add Library JUnit 4.x to folder "Test Libraries"

Upvotes: 3

Related Questions