Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Common Classes between projects
Common Classes between projects [message #170667] Wed, 28 July 2004 15:09 Go to next message
Eclipse UserFriend
Originally posted by: stledger.lanl.gov.removethis

I'm a Java developer working on a Mac OS X system, vsn 10.3.4. I'm
learning eclipse 3.0 to see if I want to use it for my IDE. I've used
CodeWarrior and Project Builder in the past.

Eclipse seems to work very well, but I have one issue that I don't like
the work around for. I want to share source files between applications
(projects).

I have seven Java applications that I distribute in Jar Files on a CD.
Each application is designed to run in its own directory, with its own
files. Each application has a number of unique classes, and shares
about 30 utility classes with the other applications. The classes are
arranged in packages, and the main class for each application is in the
default package.

Currently, I have one project, with ALL of the source files and class
files. I can run each individual application as needed.

When I create a jar file to distribute each individual application, do I
have to manually check each class file that I want included every time I
create a new jar file?

Can I somehow have one copy of a source file that is shared between
projects? (When I use a working set, and edit a file, it is only
updated in the project directory in the workspace, and not in the
working set directory in the workspace. I'm probably not setting
something up right.)

Thanx,

John

--
John St. Ledger | "Every calculation based on experience elsewhere,
| fails in New Mexico."
|
| Lew Wallace, Territorial Gov., 1878-81
Re: Common Classes between projects [message #170683 is a reply to message #170667] Wed, 28 July 2004 17:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NO.SPAM.us.ibm.com

Create a new project, put the classes that you want to share into that
project, and then using the Java Build Path for any project that needs
the common project go to the Projects page and select the common
project. This project will then be added to your needing project's
classpath.

--
Thanks, Rich Kulp

Re: Common Classes between projects [message #170754 is a reply to message #170667] Thu, 29 July 2004 10:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse.rizzoweb.com

John St. Ledger wrote:

> I'm a Java developer working on a Mac OS X system, vsn 10.3.4. I'm
> learning eclipse 3.0 to see if I want to use it for my IDE. I've used
> CodeWarrior and Project Builder in the past.
>
> Eclipse seems to work very well, but I have one issue that I don't like
> the work around for. I want to share source files between applications
> (projects).
>
> I have seven Java applications that I distribute in Jar Files on a CD.
> Each application is designed to run in its own directory, with its own
> files. Each application has a number of unique classes, and shares
> about 30 utility classes with the other applications. The classes are
> arranged in packages, and the main class for each application is in the
> default package.
>
> Currently, I have one project, with ALL of the source files and class
> files. I can run each individual application as needed.
>
> When I create a jar file to distribute each individual application, do I
> have to manually check each class file that I want included every time I
> create a new jar file?

Like someone else suggested, I think your best bet is to create a
separate Project for the shared code. Another recommendation I'll make
is to use Ant to build your distribution, including the JARs. Exporting
JARs from Eclipse works, but when you need to do more complicated things
like assemble files into particular directories and/or select a subset
of a group of files, Ant is the way to go. You can even invoke it from
Eclipse if you choose, so doing the Ant build is easy.

HTH,
Eric
Re: Common Classes between projects [message #171132 is a reply to message #170754] Mon, 02 August 2004 10:12 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse.rizzoweb.com

Eric Rizzo wrote:

> Like someone else suggested, I think your best bet is to create a
> separate Project for the shared code. Another recommendation I'll make
> is to use Ant to build your distribution, including the JARs. Exporting
> JARs from Eclipse works, but when you need to do more complicated things
> like assemble files into particular directories and/or select a subset
> of a group of files, Ant is the way to go. You can even invoke it from
> Eclipse if you choose, so doing the Ant build is easy.

For help with Ant, start here: http://ant.apache.org/

HTH,
Eric
Previous Topic:How Add a new action on save ?
Next Topic:Project references
Goto Forum:
  


Current Time: Tue Jul 22 13:11:46 EDT 2025

Powered by FUDForum. Page generated in 0.04153 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top