Classloading in Eclipse plugin [message #323989] |
Tue, 15 January 2008 12:00  |
Eclipse User |
|
|
|
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 #323998 is a reply to message #323993] |
Tue, 15 January 2008 16:22  |
Eclipse User |
|
|
|
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).
|
|
|
Powered by
FUDForum. Page generated in 0.25147 seconds