Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding a reference between Eclipse Java projects

Tags:

I have two Java projects in an Eclipse workspace, and I would like to use a class from one of them in the other.

How can I add a reference between them? I'm looking for something like adding a project reference in C#.

like image 490
Amit Raz Avatar asked Jan 25 '11 20:01

Amit Raz


People also ask

How do I reference another project in Eclipse?

Right click on Project1, then click on Properties. In the dialog that comes up, select Java Build Path, and then click on the Projects tab. There, add Project2 to the build path. If Project1 is a web app, you need to make sure your Deployment Assembly (same Properties UI) has Project2 there as well.


1 Answers

Assuming you are using Eclipse...

Right click the project -> Properties -> Java Build Path -> Projects tab

...which will allow you to force required projects on the project in questions build path.

like image 180
Aaron McIver Avatar answered Sep 25 '22 06:09

Aaron McIver