I have a new installation of NetBeans 10. Trying to run some initial unit tests I just created, I get the following error:
The
<classpath>
or<modulepath>
for<junit>
must include junit.jar if not in Ant's own classpath
I could probably hack the build script to include junit.jar
, but I want to know: what's the right way to fix this?
Shouldn't NetBeans come with a version of JUnit already accessible? Should I configure my project differently? How do I add a path to the library?
How can I find the classpath for Ant (and what version/binary NetBeans is using)?
The project Test Libraries
shows that JUnit 5.3.1 is present, I have three Jar files listed there: junit-jipiter-api, junit-jupiter-params, junit-jupiter-engine. But it seems to be not actually found.
The project is a standard Java Library (no main class). I didn't add any "extras" or mess with the default project setup that NetBeans uses. Just used the basic setup wizard thing.
Re. a reply from the NetBeans mailing list by Geertjan Wielenga, he pointed me at this thread and reply:
Yep...
We never got around to implementing JUnit 5 support for Ant based projects in NB 10.
John McDonnell
So I think it's just not going to work. I'll try the suggested reversion to JUnit 4 below.
incubating-netbeans-10.0-bin/netbeans/platform/modules/ext/
– Indium