Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes IDEs, Version Control and other tools and the fly likes j2ee project dependency and project reference Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "j2ee project dependency and project reference" Watch "j2ee project dependency and project reference" New topic
Author

j2ee project dependency and project reference

FY Hsieh
Ranch Hand

Joined: Aug 07, 2006
Posts: 73
I am using eclipse/myeclipse ide to develop EAR application. The EAR project includes some EJB projects and a WEB project. The question I have is quite general --

If I define a java class A in project proj_A, how can another java class B in a different project B able to access class A ?

Can I

1) let project B have a "project reference" to project A ?

OR

2) In the properties of project B, can I choose "j2ee module dependency" and includes "project A" there ?

which way(s) is the right way ?
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

I usually in the properties for project B select Java Build Path, Projects tab, and click Add to add project A.

By the way, I hope that project A is not the WAR otherwise this will not work at runtime.


JBoss In Action
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: j2ee project dependency and project reference