Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Classloading in Eclipse plugin
Classloading in Eclipse plugin [message #323989] Tue, 15 January 2008 12:00 Go to next message
Eclipse UserFriend
I have a plugin that interfaces to an existing compilation process that requires I set the the classpath for the process in order to properly compile. I do this by creating a URLClassLoader in my builder plugin and adding all the jars from the users project into its URL[]. The problem is, I think the URLClassLoader maintains open input streams to the jars so the users cannot delete jars they have created without shutting down eclipse and restarting. How do other eclipse builders that compile to jar handle this sort of thing? Are there existing classloaders that don't have this problem with caching access to the jars?
Re: Classloading in Eclipse plugin [message #323990 is a reply to message #323989] Tue, 15 January 2008 12:04 Go to previous messageGo to next message
Eclipse UserFriend
See http://jira.jboss.com/jira/browse/JBIDE-1012

Snjeza

ben dixon wrote:
> I have a plugin that interfaces to an existing compilation process that requires I set the the classpath for the process in order to properly compile. I do this by creating a URLClassLoader in my builder plugin and adding all the jars from the users project into its URL[]. The problem is, I think the URLClassLoader maintains open input streams to the jars so the users cannot delete jars they have created without shutting down eclipse and restarting. How do other eclipse builders that compile to jar handle this sort of thing? Are there existing classloaders that don't have this problem with caching access to the jars?
Re: Classloading in Eclipse plugin [message #323993 is a reply to message #323990] Tue, 15 January 2008 14:00 Go to previous messageGo to next message
Eclipse UserFriend
Thanks Snjeza,

The information is helpful and I'm glad to see there are others trying to solve similar problems but I was hoping to find out something about the Eclipse classloaders or how Eclipse does these things since obviously in Eclipse/JDT you can depend on jars and delete them. How are they released in this case? And if not that, perhaps there is a generic ClassLoader out there in the open source community that would handle this situation? If so, I haven't found it.
Re: Classloading in Eclipse plugin [message #323994 is a reply to message #323993] Tue, 15 January 2008 14:35 Go to previous messageGo to next message
Eclipse UserFriend
The classloader which is used in the mentioned patch is a patched
Eclipse classloader. It doesn't lock jars in contrast to the standard
Java classloader.
See the HibernateToolsContextLoader class.

Snjeza

ben dixon wrote:
> Thanks Snjeza,
>
> The information is helpful and I'm glad to see there are others trying to solve similar problems but I was hoping to find out something about the Eclipse classloaders or how Eclipse does these things since obviously in Eclipse/JDT you can depend on jars and delete them. How are they released in this case? And if not that, perhaps there is a generic ClassLoader out there in the open source community that would handle this situation? If so, I haven't found it.
Re: Classloading in Eclipse plugin [message #323998 is a reply to message #323993] Tue, 15 January 2008 16:22 Go to previous message
Eclipse UserFriend
Originally posted by: wharley.bea.com

"ben dixon" <ben.dixon@janusresearch.com> wrote in message
news:5552571.14101200423645097.JavaMail.root@cp1.dzone.com...
> Thanks Snjeza,
>
> The information is helpful and I'm glad to see there are others trying to
> solve
> similar problems but I was hoping to find out something about the Eclipse
> classloaders or how Eclipse does these things since obviously in
> Eclipse/JDT
> you can depend on jars and delete them. How are they released in this
> case?
> And if not that, perhaps there is a generic ClassLoader out there in the
> open
> source community that would handle this situation? If so, I haven't found
> it.


AFAIK, when JDT compiles against classes in a jar file, it doesn't load or
execute the classes: it just reads them.

It's important not to get confused by the distinction between the build
classpath (the set of classes that can be read during compilation), the
Eclipse runtime classpath (the set of classes that can be loaded and
executed as Eclipse runs), and the application runtime classpath (the set of
classes that will be available to be loaded and executed when your
application runs).
Previous Topic:Audio Recording and Playback
Next Topic:Editor ToolBar not working
Goto Forum:
  


Current Time: Sat Jun 07 13:54:08 EDT 2025

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

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

Back to the top