Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Adding dependant jars to Eclipse plugin?
Adding dependant jars to Eclipse plugin? [message #269945] Fri, 03 September 2004 10:54 Go to next message
Eclipse UserFriend
Originally posted by: mharp.seapine.com

Hey all,

I have a plugin that relies on the Apache Axis project, but can't seem to
figure out how to tell Eclipse to load those libraries when it loads my
plug-in. I keep getting ClassDefNotFound errors and my plugin loading fails.

I have the Axis jars in my PATH, I also added that to the lib dir of my
plugin and made the necessary <runtime> changes but they still aren't found.

<library name="lib\axis.jar">
<export name="*"/>
</library>

Can anyone explain how this is done? I'm gettin real frustrated; it seems
like adding the library elements to runtime should have worked. Second, is
there an Eclipse plug-in version of Axis somewhere out there? I can't seem
to find one, but it would be nice if I could just install Axis to Eclipse
w/o having to include it in my own plugin.

Thanks for any help you can give...

-matt
Re: Adding dependant jars to Eclipse plugin? [message #269978 is a reply to message #269945] Fri, 03 September 2004 11:09 Go to previous messageGo to next message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
Hello Harpstein,

Harpstein schrieb:
> Hey all,
>
> I have a plugin that relies on the Apache Axis project, but can't seem to
> figure out how to tell Eclipse to load those libraries when it loads my
> plug-in. I keep getting ClassDefNotFound errors and my plugin loading fails.
>
> I have the Axis jars in my PATH, I also added that to the lib dir of my
> plugin and made the necessary <runtime> changes but they still aren't found.
>
> <library name="lib\axis.jar">
> <export name="*"/>
> </library>
>
> Can anyone explain how this is done? I'm gettin real frustrated; it seems
> like adding the library elements to runtime should have worked. Second, is
> there an Eclipse plug-in version of Axis somewhere out there? I can't seem
> to find one, but it would be nice if I could just install Axis to Eclipse
> w/o having to include it in my own plugin.

Yes that behaviour is quite astonishing on first changes from pure Java
programming to plugin programming!

The point is, that you should define a single library plugin, which
actually **contains** the corresponding axis jars and does export them,
like:

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>
<plugin
id="com.example.axis"
name="Your plugin name"
version="1.0.0"
provider-name="Your provider id">

<runtime>
<library name="axis.jar">
<export name="*"/>
</library>
<library name="commons-discovery.jar">
<export name="*"/>
</library>
<library name="commons-logging.jar">
<export name="*"/>
</library>
...
</runtime>
</plugin>


Now your other plugins, which depend on the axis jar's simplply declare
their dependency on the above defined plugin (com.example.axis).

HTH

Daniel Krügler
Re: Adding dependant jars to Eclipse plugin? [message #270025 is a reply to message #269978] Fri, 03 September 2004 15:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mharp.seapine.com

"Daniel Kr
Re: Adding dependant jars to Eclipse plugin? [message #270290 is a reply to message #270025] Mon, 06 September 2004 12:51 Go to previous message
Daniel Krügler is currently offline Daniel KrüglerFriend
Messages: 853
Registered: July 2009
Senior Member
Hello Matt,

Harpstein schrieb:
> "Daniel Krügler" <dsp@bdal.de> wrote in message
> news:<41385105.8050302@bdal.de>...
>

[snip]

>
> Isn't this what I did? If I look at the org.apache.ant plugin in Eclipse for
> example; they do exactly what I did. I put the jars in a lib dir at
> "eclipse\plugins\my.example.plugin\lib", then referenced them with library
> elements under the runtime element (I put one of these as an example in my
> original post). I also had my plugin jar as a library element. My jar is at
> "eclipse\plugins\my.example.plugin\my.jar".
>
> Am I misunderstanding? Do you mean I need to create an Axis plugin that gets
> installed seperatly from my acutal plugin?
>

The problem is, that all externally referenced data are not available in
your deployed version. The same problem applies to your rcp program
started yb the Eclipse launcher, which will only "deploy" everything
from your stuff mentioned in the build file of your plugin.

What we do here that we **import** the necessary libraries into our
library plugin (or use a corresponding ant script for copying those
libraries from our actual repository into the library plugin) and mark
these libraries for binary inclusion in the build configuration.

Does this explanation help?

Greetings from Bremen,

Daniel Krügler
Previous Topic:How do I debug two plug-ins?
Next Topic:exporting mac os x app bundle
Goto Forum:
  


Current Time: Sun Oct 06 14:23:21 GMT 2024

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

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

Back to the top