Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » How add a resource to a plugin's classpath dynamically
How add a resource to a plugin's classpath dynamically [message #990526] Wed, 12 December 2012 22:03 Go to next message
Bhanu Pratap is currently offline Bhanu PratapFriend
Messages: 13
Registered: April 2010
Junior Member
Hi All

I have a scenario, where a I need to add a file to my plugins' classpath dynamically. Here are more details:

I have a plugin which when installed allows user to right click on an .xmi file and generate another file in the same directory as .xmi file. Now my plugin has to load this generated file using PDE's default resource manager(which loads resources from its classpath).

So, I have to update this classpath with the directory in which user generates this file.

I have already looked through a lot of documentation but couldn't find any feasible solution to this problem.

Could you please help me to resolve this problem.

Thanks in advance.
Re: How add a resource to a plugin's classpath dynamically [message #990677 is a reply to message #990526] Thu, 13 December 2012 18:06 Go to previous message
Curtis Windatt is currently offline Curtis WindattFriend
Messages: 166
Registered: July 2009
Senior Member
The plug-in classpath created by PDE is calculated from the dependencies specified in (require bundle, import package). If you only care about project dependencies (things that OSGi will not know about when launched) you can use JDT to add to the classpath. To add OSGi dependencies you must modify the manifest mf (see org.eclipse.pde.core.project for an API).

There are other ways of dynamically changing the classpath, but I am not familiar with the details. Here is a bug that we are considering to support equinox adapter hooks:
Previous Topic:Problem refreshing Variables View
Next Topic:Recommended Use of Target Platform Definition File
Goto Forum:

Current Time: Thu Apr 26 23:24:20 GMT 2018

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

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