Suppose there are many simple projects, A, B, C, each of which needs to use the same general project Z. All parts are in the process of development.
So we add project Z as a library to A, B and C.
As an example: Class A has a single method: main (). Class Z is a simple JFrame-based form. Z includes NB IDE default main () to create an instance of the form, so it can be run separately, but in the example use A.main () calls Z.main () to show the form.
This works fine for a simple form in class Z.
However, suppose we add components to the Z class from SwingX or other non-standard libraries. This is an automatic addition of the appropriate library dependencies to the Z project. We can check Z by running Z.main () directly - it works fine. However, if we recompile and run A.main () now, an exception is thrown: the SwingX library (or something else) cannot be found.
This can be made to work by adding the Z dependencies to A. Therefore, the problem is that this mechanism for adding a project as a library does not care about adding the dependencies of this other library / project.
What is the right solution?
Netbeans 7.2 using ANT.
There may be a duplicate of these similar questions that do not have verified answers:
add other projects as a library in netbeans
Netbeans - adding a library that is currently being edited
source share