How do I automatically add certain *.jars to ALL projects? [message #332287] |
Fri, 17 October 2008 07:05 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Ed Merks Messages: 33264 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/
|
|
|
Powered by
FUDForum. Page generated in 0.02366 seconds