How to add a JAR in NetBeans

Pam picture Pam · Feb 2, 2011 · Viewed 210.9k times · Source

Let's say you create a new project, and want it to make use of some 3rd party library, say, widget.jar. Where do you add this JAR:

  1. File >> Project Properties >> Libraries >> Compile-Time Libraries; or
  2. File >> Project Properties >> Libraries >> Run-Time Libraries; or
  3. Tools >> Libraries (Library Manager) >> Library Classpath; or
  4. Tools >> Java Platforms (Java Platform Manager)

All of these dialogs seem to do the same thing but I'm sure they all have their proper usages. Can't find a good "best practices" article online and the NetBeans Help Contents dialog isn't helping with this either.

Answer

Petah picture Petah · Feb 2, 2011

Right click 'libraries' in the project list, then click add.