Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » File Path to jar inside another jar(Path seems to be non-valid)
File Path to jar inside another jar [message #904563] Tue, 28 August 2012 17:30 Go to next message
Cedric Reichenbach is currently offline Cedric ReichenbachFriend
Messages: 7
Registered: March 2012
Junior Member
Hi y'all

For an Eclipse plugin, I need to refer to a jar file inside the plugin directory (to provide code to users). This works perfectly when running the plugin while developing (inside a runtime-eclipse-application).

But when I build an update site, my plugin is built into a jar file. File paths for images are still working, but when the jar should be imported, eclipse shows the following error:
Description Resource Path Location Type The container 'DoodleDebug' references non existing library 'file:\C:\Users\Me\.eclipse\org.eclipse.platform_3.7.0_740800064\plugins\ch.unibe.scg.doodledebug_1.0.0.201208281642.jar!\DoodleDebug-Client.jar'


The outer jar path is correct and when inspecting it with WinRAR, I can see the desired jar file inside it!

Why isn't this working as expected?

Cheers
Cedric
Re: File Path to jar inside another jar [message #904938 is a reply to message #904563] Wed, 29 August 2012 12:18 Go to previous messageGo to next message
Joseph Carroll is currently offline Joseph CarrollFriend
Messages: 174
Registered: May 2012
Location: Milwaukee, WI
Senior Member

What does your manifest look like?

You should have something that looks like:
Bundle-ClassPath: lib/com.foo.jar,
 .


Including the '.' on a separate line is important.

JD
Re: File Path to jar inside another jar [message #905001 is a reply to message #904938] Wed, 29 August 2012 14:37 Go to previous messageGo to next message
Cedric Reichenbach is currently offline Cedric ReichenbachFriend
Messages: 7
Registered: March 2012
Junior Member
Thanks for your reply, but I could solve it now:
I had to set
Eclipse-BundleShape: dir

in my MANIFEST.MF (directly in source code) and set a tick at
Unpack the plug-in archive after the installation

under the tab "Plug-ins", so my plugin is installed in an exploded form instead of in an archive.
Directly refer to a jar inside another one seems to be impossible.

Cheers
Cedric
Re: File Path to jar inside another jar [message #905474 is a reply to message #905001] Thu, 30 August 2012 12:51 Go to previous messageGo to next message
Joseph Carroll is currently offline Joseph CarrollFriend
Messages: 174
Registered: May 2012
Location: Milwaukee, WI
Senior Member

Glad its working and good to know Wink


JD
Re: File Path to jar inside another jar [message #906047 is a reply to message #905474] Fri, 31 August 2012 14:13 Go to previous messageGo to next message
Curtis Windatt is currently offline Curtis WindattFriend
Messages: 166
Registered: July 2009
Senior Member
Nested Jars are not supported. We can request files from inside a plug-in, but there is no ability to extract context from a jar inside a jarred plug-in. The solution we have traditionally used is the one Cedric suggests last, changing the plugin shape to be a directory.

Depending on your use case, it is possible to extract data from the jar file, but you must do so manually (explode it into a temporary directory then extract the necessary files yourself).
Re: File Path to jar inside another jar [message #906103 is a reply to message #906047] Fri, 31 August 2012 16:13 Go to previous message
Cedric Reichenbach is currently offline Cedric ReichenbachFriend
Messages: 7
Registered: March 2012
Junior Member
But I could use Images from within the plugin jar, or does eclipse create some kind of a virtual copy when using
ImageDescriptor.createImage()
?
Previous Topic:Creating extensions in plugin.xml programmatically?
Next Topic:Reading resources from a Eclipse plugin ?
Goto Forum:
  


Current Time: Fri Apr 26 06:23:08 GMT 2024

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

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

Back to the top