Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NetBeans Library Types

Tags:

java

netbeans

I'm choking on a few terminologies that are either Java- or NetBeans-specific and I can't seem to get a clear answer as to what they are.

In NetBeans, if you go to File >> Project Properties there is a Category called Libraries which houses, principally, 3 different types of libs:

(1) Compile-Time Libraries (2) Processor-Path Libraries and (3) Runtime Libraries

Can someone explain to me the subtle differences between these libraries? Obviously compile-time and runtime libraries involve things that happen at compile- or run-time, respectively. But I'm not sure what those "things" are. But the processor path libraries is something I've never even heard of.

Also, (4) can someone clarify that by "libraries" we're talking about 3rd party JARs?

Thanks for any and all insight!

like image 302
Pam Avatar asked Feb 02 '11 16:02

Pam


People also ask

Where are Libraries in NetBeans?

Select Tools > Libraries to open up the Library Manager. Click the button Add JAR/Folder and browse to the lib folder within the ImageGear for Java installation directory.

What is NetBeans module?

A NetBeans module is a group of Java classes that provides an application with a specific feature. You can also create new modules for NetBeans IDE itself. For example, you can write modules that make your favorite cutting-edge technologies available to users of NetBeans IDE.

How use external library in NetBeans?

Adding External JAR file in NetBeans ProjectIn the project properties window, click on the Libraries node at the left Categories pane. Then on the right side, click on the Run tab and then click on the Add JAR/Folder button and browse the external JAR files you want to add, as shown in the below image.

What is Palette in NetBeans?

The component palette provides quick access to commonly used components (JavaBeans) available for adding to forms. The components are organized in categories. Click on a category header to expand or collapse a category.


1 Answers

The UI and terminology of the Libraries properties is a bit confusing.

The Help button on the dialog does bring up a pretty good description of various 'types' of libraries, when I looked at a recent nightly build of NetBeans.

I do want to provide a bit more insight on the difference between Compile and Run libraries, though.

A Compile-time library is used at compilation time to resolve symbols and the like while your Java code is converted into classes.

A Run-time library is used to support the actual execution of your program.

The Compile-time library list can be a subset of the Run-time library list, since you may depend on a library A that depends on a library B which is not exposed to clients of A. Your code will compile correctly if A is in the Compile-time library list, but it will trigger ClassNotFoundException's when when you try to run it without B in the Run-time library list.

In the context of the Libraries property editor a library can be:

  • A jar file,
  • A directory,
  • A NetBeans library (Open the Library Manager dialog [Tools->Libraries] to find out more), OR
  • A NetBeans IDE project
like image 163
vkraemer Avatar answered Sep 23 '22 02:09

vkraemer