I'm wondering how can I reference another project in Eclipse Java EE projects, just like you do in normal Java Projects. In fact I'd like to be able to separate development in multiple projects and still be able to debug and work with each. Instead I can reference projects in Java EE projects, but this doesn't automatically put the Jar inside WEB-INF/lib. How do you set up to do this? This is necessary as you grow up from simple webapps to more complex ones.
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.
Yes. In the Project Explorer right click on it and select Properties, there go to Java Build Path and select Projects tab. Add your other project here, now you're able to use the classes from it in your current project.
On the Java Build Path part of the dialog, select the Libraries tab. Click Add Library button. Select WebLogic Shared Library, and then click Next. Click Browse, and choose the library that you want to reference.
Instead open the project properties of the second project and select "Java Build Path". On the right side on the "Projects" tab you can add your first project as "required project on the build path". The class files of project 1 are now added to the class path of project 2.
This is done under Deployment Properties section of the project properties (reachable via context menu of the project).You add/remove projects, jars libraries to be assembled to your deployment unit from there.
Edit: As of Eclipse Kepler, you can find this by right-clicking the project and picking Deployment Assembly
. Click Add
and add the dependency project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With