This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 199953

Summary: "Could not find the JUnit 4 library in the target platform; you need to install JUnit."
Product: platform Reporter: dtrebbien
Component: Module SystemAssignee: Jaroslav Tulach <jtulach>
Status: RESOLVED DUPLICATE    
Severity: normal CC: dtrebbien, jglick, jrechtacek, ynov
Priority: P3    
Version: 7.0.1   
Hardware: PC   
OS: Windows 7 x64   
Issue Type: DEFECT Exception Reporter:
Attachments: Error dialog screenshot
Adding Missing Dependencies screenshot
NetBeans IDE Installer screenshot

Description dtrebbien 2011-07-07 16:20:06 UTC
Created attachment 109297 [details]
Error dialog screenshot

After downloading and installing NetBeans 7.0.1 RC1 this morning, I am experiencing a problem with the JUnit plugin.  It appears that NetBeans cannot use the JUnit 4 library that was installed.

Steps to reproduce:
0.  Uninstall the JUnit plugin if installed.  Restart the IDE.
1.  Open a NetBeans Module project that uses JUnit 4.
2.  Right click on Unit Test Libraries, select Add Missing Dependencies.  The dialog that I now see is the attached screenshot `Adding Missing Dependencies screenshot.png`.
3.  Click Yes.  I now see the NetBeans IDE Installer dialog for installing the JUnit plugin.  See `NetBeans IDE Installer screenshot.png`.
4.  Click "Next >".  Check "I accept the terms in all of the license agreements."  Click Install.  (NetBeans installs the plugin.)  Click Finish.
5.  The dialog that I now see is the attached screenshot `Error screenshot.png`.  The dialog text is "Could not find the JUnit 4 library in the target platform; you need to install JUnit."
Comment 1 dtrebbien 2011-07-07 16:20:49 UTC
Created attachment 109298 [details]
Adding Missing Dependencies screenshot
Comment 2 dtrebbien 2011-07-07 16:21:22 UTC
Created attachment 109299 [details]
NetBeans IDE Installer screenshot
Comment 3 dtrebbien 2011-07-07 17:44:48 UTC
This now appears to me to be a problem with the module system.

The org-netbeans-libs-junit4 module was installed to `%UserProfile%\.netbeans\7.0.1rc1\modules`, but the NetBeans Platform Manager does not know to look there for the org-netbeans-libs-junit4 module.

I copied `%UserProfile%\.netbeans\7.0.1rc1\modules\org-netbeans-libs-junit4.jar` to `C:\Program Files\NetBeans 7.0.1 RC1\java\modules`, copied `%UserProfile%\.netbeans\7.0.1rc1\modules\ext\junit-4.8.2.jar` to `C:\Program Files\NetBeans 7.0.1 RC1\java\modules\ext`, restarted NetBeans, and saw that "JUnit 4" was then listed on the Modules list for "NetBeans IDE 7.0.1 RC1 (Build 201106222100) (Default)".
Comment 4 Jiri Rechtacek 2011-07-08 09:51:58 UTC
I can reproduce it.
1) install NB701 RC1 as root, accept JUnit licence
2) run IDE and wait for install of JUnit
3) open NetBeans Project which uses Junit4 =>
Test classes are marked red because missing JUnit lib, invoke Add Missing Dependencies on Unit Test Libraries doesn't help, the Error dialog is shown.
Comment 5 Jesse Glick 2011-07-08 14:00:13 UTC

*** This bug has been marked as a duplicate of bug 198739 ***