Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

j2ee project dependency and project reference

 
FY Hsieh
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic