Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » How do I automatically add certain *.jars to ALL projects?
How do I automatically add certain *.jars to ALL projects? [message #332287] Fri, 17 October 2008 07:05 Go to next message
Eclipse UserFriend
Originally posted by: markmccloud200.email.com

There are some *.jar archives which are used by many (or even all projects).
E.g. log4j.

As far as I know I have to add the log4j.jar to every project
which I create.

Is there a more convenient way? I want to define a set of jars which
should be added to all projects atomatically.

When I define e.g. jars in Preferences->Java->Build Path->User libraries
then they are NOT automatically added to new/existing projects.

How can I achieve this otherwise?

Mark
Re: How do I automatically add certain *.jars to ALL projects? [message #332296 is a reply to message #332287] Fri, 17 October 2008 13:29 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Mark McCloud wrote:
> There are some *.jar archives which are used by many (or even all projects).
> E.g. log4j.
>
> As far as I know I have to add the log4j.jar to every project
> which I create.
>
> Is there a more convenient way? I want to define a set of jars which
> should be added to all projects atomatically.
>
> When I define e.g. jars in Preferences->Java->Build Path->User libraries
> then they are NOT automatically added to new/existing projects.
>
> How can I achieve this otherwise?

There is no mechanism to push a set of JARs to all projects. You are
already aware of what would be my first suggestion, User Libraries.
The only other thing I can think of (it is very hokey and I would never
do it myself) would be to edit the JRE configuration in your workspace
preferences and add the JAR(s) to what is considered the "JRE System
libraries." Note that this is workspace-specific and thus can't be
checked in so other developers (or other workspaces on your own machine)
will have to do it manually. I reiterate that this is a complete hack
and misuse of the JRE configuration, and I'm not even sure it will work
for build path (it is really designed for runtime classpath).

Is there a reason a User Library won't meet your needs, other than being
one extra thing you have to add to all projects, one time each?

Eric
Re: How do I automatically add certain *.jars to ALL projects? [message #332355 is a reply to message #332287] Mon, 20 October 2008 10:39 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33254
Registered: July 2009
Senior Member
Mark,

Your posting has a "followup-to" in it. What causes that? It would be
best to avoid doing that when cross posting...

It seems best to create a project with all these jars in it, and then
make your other projects depend on it... Generally I find it much
easier to develop using plugin projects, even if you only want to
develop jars that you'll be using in a stand alone application, because
then you can reply on managing dependencies via the MANIFEST.MF and not
have to worry about managing the classpath directly.


Mark McCloud wrote:
> There are some *.jar archives which are used by many (or even all projects).
> E.g. log4j.
>
> As far as I know I have to add the log4j.jar to every project
> which I create.
>
> Is there a more convenient way? I want to define a set of jars which
> should be added to all projects atomatically.
>
> When I define e.g. jars in Preferences->Java->Build Path->User libraries
> then they are NOT automatically added to new/existing projects.
>
> How can I achieve this otherwise?
>
> Mark
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:WTP plugin for Eclipse 3.3.2 needs (but can not!) download GEF version v3.4 ? Solution?
Next Topic:view action delegate with sub menu ...
Goto Forum:
  


Current Time: Tue Nov 12 22:20:09 GMT 2024

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

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

Back to the top