File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes IDEs, Version Control and other tools and the fly likes access java classes defined in another project in Eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "access java classes defined in another project in Eclipse" Watch "access java classes defined in another project in Eclipse" New topic
Author

access java classes defined in another project in Eclipse

ben oliver
Ranch Hand

Joined: Mar 28, 2006
Posts: 375
I created a j2ee enterprise project which includes few EJB projects and one Web project. I also created a standalone java project.

In order for my ejb project java code to use the java class defined in that standalone project, I tried the following ways --

a) For the EJB project, I added that standalone project in its "project reference"
b) For the EJB project, in its Java Build path, I added that stand alone project in the "project" tab.

It seems only method b) works and method a) does not.

Wondering why ? I thought if a project A has project B in A's project reference, then any java code in Project B should be visible to java code defined in project A, correct ?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16222
    
  21

You don't reference a project in a build, you reference resources.

For example, you might want Project B to be able to use Project A's build classes, but not its test classes. Referring to Project A as a unit wouldn't allow you to make that distinction.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: access java classes defined in another project in Eclipse