How do I reference classes from another project in NetBeans?

9.6k Views Asked by At

I am using NetBeans 6.8.

I have a class ClassA situated in PackageA in JavaApplicationProject1.

I plan to use this class in ClassB situated in PackageB in JavaApplicationProject2 just by importing it. One option is to copy ClassA in PackageB, but I don't want to copy. How can I do this?

1

There are 1 best solutions below

0
Michael Lang On

Under Project Properties -> Libraries -> Compile -> Add Project you can add project dependencies. So adding JavaApplicationProject1 as a project dependency in JavaApplicationProject2 will do what you want. Details can be found in this guide