Neetesh Dadwariya
Neetesh Dadwariya

Reputation: 765

How do I reference classes from another project in NetBeans?

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?

Upvotes: 1

Views: 9766

Answers (1)

Michael Lang
Michael Lang

Reputation: 3992

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

Upvotes: 10

Related Questions