Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Project's classpath available to plugin
Project's classpath available to plugin [message #536727] Sun, 30 May 2010 12:29 Go to next message
Filip Kis is currently offline Filip KisFriend
Messages: 31
Registered: April 2010
Member
Hi there!

I have a following situation. I'm working on a plugin with deals with special kind of java projects. During the execution of the plugin I need to run some third party jars that I have available in my plugin. This all works fine, however the third party jars expect some resources on the classpath that the user will have in his project. I don't want to add them to my plugin, because they have to be project specific.

So is there any way to add some resources from users project to my plug-ins classpath (and then remove them after the execution of course).

Filip
Re: Project's classpath available to plugin [message #536891 is a reply to message #536727] Mon, 31 May 2010 12:36 Go to previous messageGo to next message
Martin Skorsky is currently offline Martin SkorskyFriend
Messages: 112
Registered: July 2009
Senior Member
You can use
jproject.setRawClasspath(newRawClasspath, new NullProgressMonitor())
where jproject is some IJavaProject and newRawClasspath is a IClasspathEntry[].

HTH

Martin
Re: Project's classpath available to plugin [message #536956 is a reply to message #536891] Mon, 31 May 2010 16:43 Go to previous messageGo to next message
Filip Kis is currently offline Filip KisFriend
Messages: 31
Registered: April 2010
Member
Hi Martin,

thank you for your response.

However I'm not sure your solution provides what I need. It adds add entry to the project's classpath. But that's not what I need. I need an entry on my plug-ins classpath. But the entry will come from the users project.

So let's say user selects a command on one of his projects, then my plugin is executed, searches users project for a resource and when finds it adds it to the plugins classpath and then executes a third party library that is able to use the resource because it is on the classpath.

Filip
Re: Project's classpath available to plugin [message #537119 is a reply to message #536956] Tue, 01 June 2010 11:41 Go to previous message
Martin Skorsky is currently offline Martin SkorskyFriend
Messages: 112
Registered: July 2009
Senior Member
Hi Filip,

I guess buddy class loading can help. See http://www.eclipsezone.com/articles/eclipse-vms/.

Martin
Re: Project's classpath available to plugin [message #605894 is a reply to message #536891] Mon, 31 May 2010 16:43 Go to previous message
Filip Kis is currently offline Filip KisFriend
Messages: 31
Registered: April 2010
Member
Hi Martin,

thank you for your response.

However I'm not sure your solution provides what I need. It adds add entry to the project's classpath. But that's not what I need. I need an entry on my plug-ins classpath. But the entry will come from the users project.

So let's say user selects a command on one of his projects, then my plugin is executed, searches users project for a resource and when finds it adds it to the plugins classpath and then executes a third party library that is able to use the resource because it is on the classpath.

Filip
--
www.makumba.org - webapps in the fast lane
Re: Project's classpath available to plugin [message #605898 is a reply to message #605894] Tue, 01 June 2010 11:41 Go to previous message
Martin Skorsky is currently offline Martin SkorskyFriend
Messages: 112
Registered: July 2009
Senior Member
Hi Filip,

I guess buddy class loading can help. See http://www.eclipsezone.com/articles/eclipse-vms/

Martin
Previous Topic:Linux ant unzip issue
Next Topic:How to create a p2 repo programmatically
Goto Forum:
  


Current Time: Thu Apr 25 23:57:17 GMT 2024

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

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

Back to the top