Skip to main content



      Home
Home » Newcomers » Newcomers » Plug-in runtime classpath - How does it work?
Plug-in runtime classpath - How does it work? [message #266960] Tue, 09 December 2008 01:40 Go to next message
Eclipse UserFriend
Hey,

In the PDE Plug-in Manifest Editor, I can specify the classpath for my
plug-in (the list at the bottom right, titled 'classpath').

Just to test this, I ad a random external library, say 'library.jar' to
it, which is in the 'libs' folder of my plugin. Now I export the plugin
into a single jar with the export wizard. The exported jar contains the
library.jar in the libs folder.


The manifest contains :
Bundle-ClassPath: lib/com.playw.toolbox.jar,
lib/library.jar

What I am now curious about is how classes in the library.jar get
resolved during runtime.

This seems just kind of magic.. Does the eclipse runtime rely on a
custom classloader that searches the nested jars when required?


Thankx for explaining.
Felix
Re: Plug-in runtime classpath - How does it work? [message #266966 is a reply to message #266960] Tue, 09 December 2008 06:07 Go to previous messageGo to next message
Eclipse UserFriend
Felix,

When Eclipse detects this case that you have jars within jars (nested
jars) it will unzip the jar into the local file system (once and cache
it) so that the nested jars can be put on the classpath. As such, it's
not a great idea to nest jars in jarred plugins. It's better to put
them in a different plugin that isn't jarred.


Felix Dorner wrote:
> Hey,
>
> In the PDE Plug-in Manifest Editor, I can specify the classpath for my
> plug-in (the list at the bottom right, titled 'classpath').
>
> Just to test this, I ad a random external library, say 'library.jar'
> to it, which is in the 'libs' folder of my plugin. Now I export the
> plugin into a single jar with the export wizard. The exported jar
> contains the library.jar in the libs folder.
>
>
> The manifest contains :
> Bundle-ClassPath: lib/com.playw.toolbox.jar,
> lib/library.jar
>
> What I am now curious about is how classes in the library.jar get
> resolved during runtime.
>
> This seems just kind of magic.. Does the eclipse runtime rely on a
> custom classloader that searches the nested jars when required?
>
>
> Thankx for explaining.
> Felix
Re: Plug-in runtime classpath - How does it work? [message #266972 is a reply to message #266966] Tue, 09 December 2008 08:38 Go to previous message
Eclipse UserFriend
Hey Ed,

thanks a lot for the explanation. Actually asking if there's a way to
not jar the plugin would have been my next question. I simply unchecked
the "Package plug-ins as individual jar archives" option in the Export
Wizard. Nice.

Felix

> When Eclipse detects this case that you have jars within jars (nested
> jars) it will unzip the jar into the local file system (once and cache
> it) so that the nested jars can be put on the classpath. As such, it's
> not a great idea to nest jars in jarred plugins. It's better to put
> them in a different plugin that isn't jarred.
Previous Topic:Can change bin directory not automatically call builder?
Next Topic:Disable current line number display?
Goto Forum:
  


Current Time: Tue Nov 04 06:26:04 EST 2025

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

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

Back to the top