Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » dynamically updating plugin classpath
dynamically updating plugin classpath [message #334888] Fri, 06 March 2009 18:57 Go to next message
jeevan is currently offline jeevanFriend
Messages: 20
Registered: July 2009
Junior Member
Is it possible to modify the classpath of a plugin dynamically.

I make use of some external jar files in my application, for which, I make
use of the
external:$LOCATION$/xxx.jar

where $LOCATION is an environment variable, which works fine.

I now have a situation where the user can specify a diffrent location for
the jar file while using the application. I need to figure out how to
replace the old jar with the new in the plgin CP.

Is there an api to access the manifest file and update the classpath
entry? If that is possible, maybe I could reload the plugin and the new
classpath would be effective.

Any suggestions?

Thanks
Jeevan
Re: dynamically updating plugin classpath [message #334889 is a reply to message #334888] Fri, 06 March 2009 20:11 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Are they pointing to a different location so they can pick up a later
version? Updating libs by dynamically loading bundles with different
versions is handled relatively well by the OSGi framework.

You might have to uninstall your bundle, write a new manifest, and then
re-install your newly updated bundle.

I have a bad example of supplying multiple versions of a "lib" to the
system attached to https://bugs.eclipse.org/bugs/show_bug.cgi?id=263723

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: dynamically updating plugin classpath [message #334899 is a reply to message #334889] Mon, 09 March 2009 13:45 Go to previous messageGo to next message
jeevan is currently offline jeevanFriend
Messages: 20
Registered: July 2009
Junior Member
The way it is now, I can change the environment variable and it works fine
(but, I need to exit the application). I am trying to do this without
exiting the application, the reason why I was looking to update the
manifest file.
With you solution, I still need to exit the application.

Thanks
Jeevan



Paul Webster wrote:

> Are they pointing to a different location so they can pick up a later
> version? Updating libs by dynamically loading bundles with different
> versions is handled relatively well by the OSGi framework.

> You might have to uninstall your bundle, write a new manifest, and then
> re-install your newly updated bundle.

> I have a bad example of supplying multiple versions of a "lib" to the
> system attached to https://bugs.eclipse.org/bugs/show_bug.cgi?id=263723

> PW
Re: dynamically updating plugin classpath [message #334900 is a reply to message #334899] Mon, 09 March 2009 14:02 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

jeevan wrote:
> The way it is now, I can change the environment variable and it works
> fine (but, I need to exit the application). I am trying to do this
> without exiting the application, the reason why I was looking to update
> the manifest file.
> With you solution, I still need to exit the application.

why? If you uninstall the bundle it's gone ... then you re-install the
bundle with the updated variable. I would imagine if you are using
system properties, uninstalling, change the property, and re-installing
would allow the system property to be read a second time.

Nothing in my post or example said "and restart the workbench" :-)

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: dynamically updating plugin classpath [message #334934 is a reply to message #334900] Tue, 10 March 2009 17:32 Go to previous messageGo to next message
jeevan is currently offline jeevanFriend
Messages: 20
Registered: July 2009
Junior Member
I tried the solution, but, Eclipse does not let the user change system
properties programmatically.



Paul Webster wrote:

> jeevan wrote:
>> The way it is now, I can change the environment variable and it works
>> fine (but, I need to exit the application). I am trying to do this
>> without exiting the application, the reason why I was looking to update
>> the manifest file.
>> With you solution, I still need to exit the application.

> why? If you uninstall the bundle it's gone ... then you re-install the
> bundle with the updated variable. I would imagine if you are using
> system properties, uninstalling, change the property, and re-installing
> would allow the system property to be read a second time.

> Nothing in my post or example said "and restart the workbench" :-)

> PW
Re: dynamically updating plugin classpath [message #335309 is a reply to message #334934] Tue, 31 March 2009 18:09 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

jeevan wrote:
> I tried the solution, but, Eclipse does not let the user change system
> properties programmatically.

In what way? System.setProperty(*) thows a SecurityException?

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:Adding filter in Project Explorer
Next Topic:LTK copy refactoring
Goto Forum:
  


Current Time: Wed May 08 01:48:16 GMT 2024

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

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

Back to the top