Because of remove JUnit library from NetBeans 7.0 distribution we need allow IDE users to use testing infrastructure smoothly.
One of solution is use NetBeans installer to install JUnit libs on user's confirmation.
Tracked as Issue 195123

Missing JUnit open issues


Possible solutions:

Summary of benefits and open issues of each particular solutions:

Using updater.jar


  • Need to solve possible network problems while downloading
  • Need to handle Network Proxy settings
  • In case of run the installer as root, unable to run updater.jar on 1st start due to lack of write permission

==> Unfeasible

Using Autoupdate Services API

  • Run NetBeans platform from installer and install JUnit lib using API

Open Issues:

  • Run NB Platform in headless mode?
  • If headless mode, lack of UI for solving Network Proxy settings
  • Need new CLI option in NB launcher

Via the AutoUpdate Ant task

  • The download of JUnit shall be available only in Java based distributions and they are known to have Ant inside the Java cluster. Thus the whole code simplest to invoking Ant from installer (either with premade build.xml or directly).
<taskdef name="autoupdate" classpath="${netbeans}/harness/tasks.jar"
<autoupdate installdir="${netbeans}"
  <modules includes=".*junit.*" clusters="platform[0-9]*"/>
  • exec NB launcher to detect Proxy settings from system


  • Need to solve possible network problems while downloading
  • Need to handle Network Proxy settings
  • Make a copy Network Proxy (own from Platform into installer

Library registration

  • Write the module files to nb/config directory in IDE installation. I.e. the installer would write nb/config/org-netbeans-api-project-libraries/Libraries/junit-*.xml. This is a solution that we already use for registering bundled runtimes (GlassFish, Tomcat, JavaDB).


  • Application built on NB Platform needs libs.junit4, adding the JUnit library is not enough for them
  • dtto - solve network problems while downloading jars

Create JUnit files directly

  • For various reasons the modules (o.n.libs.junit4, o.n.m.junitlib) actually have to be installed, not just the library definitions. Of course the installer could create the appropriate files directly rather than going through AU:


  • dtto - solve network problems while downloading jars
  • much more error-prone that just getting the NBMs from the Stable UC, since the installer would need to track every minor change in the content of these modules.

Installer just makes a flag

  • The installer just makes a flag according of user's confirmation, then in the first run of IDE the installation will be completed
  • download&install in the background

Open Issues:

  • how to notify users while download&install?
  • which module will handle it? autoupdate? junit wrapper? but the wrapper is usually turned off in the first start of full IDE


Jano Rojcek's Mockup:

1. The installer would show a special JUnit license panel as a next step
following the IDE license panel. In addition to the JUnit license, it would
contain two radio button options similar to:

( ) I accept the terms in the JUnit license agreement. Install JUnit.
( ) Do not install JUnit

2. The actual download and installation would happen after pressing the Install
button on the summary panel. Perhaps as a continuing progress after the IDE
installation. No special step is necessary. If download fails for some reason,
it would give the user option to fix the internet connection or skip the
download and JUnit installation.

Open Issues in UI:

  • would be useful to also have a Set Proxy... button. Often installation will fail because proxy was not detected correctly, so we may want to give the user the option to specify it manually.
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo