Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Add jar for plugin dynamically
Add jar for plugin dynamically [message #317632] Tue, 10 July 2007 18:02 Go to next message
Waldyn Benbenek is currently offline Waldyn BenbenekFriend
Messages: 24
Registered: July 2009
Junior Member
In order to run a plugin I am writing, I need to reference a jar that cannot
be shipped with the plugin. I need to reference it on the fly after the
plugin is loaded.

How can I do that?
Re: Add jar for plugin dynamically [message #317641 is a reply to message #317632] Tue, 10 July 2007 22:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

Get them to ship it as a plugin, and then depend on that :-)

Alex.
Re: Add jar for plugin dynamically [message #317650 is a reply to message #317632] Wed, 11 July 2007 11:20 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Waldyn Benbenek wrote:
> In order to run a plugin I am writing, I need to reference a jar that cannot
> be shipped with the plugin. I need to reference it on the fly after the
> plugin is loaded.
>
> How can I do that?

As Alex said, if you can get them to create an OSGi MANIFEST for their
jar, then you could just use it :-)

2 other solutions that come to mind: 1) have your installer create a
plugin and copy the jar into it for use. If you do it as part of your
install, then you won't have to worry about dynamically updating
classpaths and stuff. 2) create the plugin and use the external:
modifier in the Bundle-ClassPath header, like
external:/opt/local/libs/log4j-1.0.0.jar

Later,
PW


Re: Add jar for plugin dynamically [message #317662 is a reply to message #317650] Wed, 11 July 2007 13:16 Go to previous message
Eclipse UserFriend
Originally posted by: automatic.javalobby.org

(Be aware that the external: support is something specific to Equinox, not an OSGi thing).

One last idea; distribute a placeholder plugin as an expanded directory with a Bundle-ClassPath: .,external.jar, and then ask the users upon installation to put the 'external.jar' into your expanded bundle directory. That would just work.

You could configure an activator to try and load the class, so you'd know if they'd done it properly or not.

Alex.
Previous Topic:Event context
Next Topic:ProgressMonitorDialog in background
Goto Forum:
  


Current Time: Sat Aug 17 06:43:19 GMT 2024

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

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

Back to the top