Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2007

Tip: Looking for answers? Try searching our database.

Eclipse Reference Anthoer project

Thread view: 
Liming - 18 Feb 2007 23:46 GMT
Hey guys,

I'm coming from the .net background and I've been out of java
development for a few years so please bear with me.

How do I reference another project in eclipese? I have a web project
and another java project (business logic, data access logic, etc), I
want to reference the java projects from within the web project in the
IDE, i cna't find where to reference them.

one solution of course is to export jar files from the java projects
and drop them into my web project, but I don't wanne do that manually.
I could write a custom ant file i suppose, but I would like to know
where to do that in Eclipse IDE.

Also, say I can reference the java projects in some ways, is there an
automatic way after "build" that all java projects are compiled intos
jars and automatically dropped into my web project's lib directory?
This way, everytime after I compile, if i want to deploy, all i need
to focus on is my web project. This is similar to the dll idea from
visual studio.

Thanks.
Chris Smith - 19 Feb 2007 00:40 GMT
> How do I reference another project in eclipese? I have a web project
> and another java project (business logic, data access logic, etc), I
> want to reference the java projects from within the web project in the
> IDE, i cna't find where to reference them.

Choose properties on the project, and click "Java Build Path" on the
left margin.  Choose the Projects tab, and check the project you need to
include.

> Also, say I can reference the java projects in some ways, is there an
> automatic way after "build" that all java projects are compiled intos
> jars and automatically dropped into my web project's lib directory?

You can certainly add this as a custom build step.  Better yet, do it
with an ant script, and use the ant script to deploy your project.  Then
you aren't so tied to the IDE.

Signature

Chris Smith

Liming - 19 Feb 2007 20:48 GMT
> > How do I reference another project in eclipese? I have a web project
> > and another java project (business logic, data access logic, etc), I
[quoted text clipped - 15 lines]
> --
> Chris Smith

Thanks a lot Chris. After some reading, I found out Maven project
offers exactly what I need and simplify even further of what I need to
do with Ant script.  By declare a dependency on my DAO java project
from my web app project, my DAO*.jar files will be automatically
dropped into my web-inf/lib directory.

I'm just suprised that these kinds of build are not build into Java
IDEs directly.  Visual Studio by default, when I reference another
project, the other project's dll will get compiled and dropped into my
current project's bin folder (the equalivent of lib directory under
WEB-INF).

Maven definitly helps out here, but still, need to get it installed
just for setting  up my structure.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.