Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Adding a jar to an RCP application
Adding a jar to an RCP application [message #467212] Tue, 01 May 2007 07:30 Go to next message
Eclipse UserFriend
Originally posted by: moutaz.ahmed.gmail.com

hii

when i add a jar (which i created from another project) to my RCP application as "Add External Jar",
the application sees all the classes and packages in it but when i make an instance (object) of any class of this Jar and add it to any view, this RUN TIME ERROR MEASSAGE is out in the view where i added to it the object:

"java.lang.NoClassDefFoundError"
Re: Adding a jar to an RCP application [message #467214 is a reply to message #467212] Tue, 01 May 2007 10:21 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
You need to add it to the META-INF/MANIFEST.MF -- there should be a Bundle-ClassPath: entry which needs to read:

Bundle-ClassPath: your.jar,.

Alex.
Re: Adding a jar to an RCP application [message #467216 is a reply to message #467214] Tue, 01 May 2007 11:22 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: moutaz.ahmed.gmail.com

thx for ur response

but i try this solution and it didn't work

the same ERROR is out at runtime.
Re: Adding a jar to an RCP application [message #467221 is a reply to message #467216] Tue, 01 May 2007 14:30 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
What does your MANIFEST.MF and .classpath look like? Can you post them here?
Re: Adding a jar to an RCP application [message #467240 is a reply to message #467212] Tue, 01 May 2007 23:37 Go to previous messageGo to next message
J. Michael Dean, M.D. is currently offline J. Michael Dean, M.D.Friend
Messages: 218
Registered: July 2009
Senior Member
I usually wrap the jar in a plugin of its own and then add the plugin
dependency. It is trivial to create a plugin that wraps a jar. I think
this is necessary to get all the classpath issues to work out.

- Mike


On 5/1/07 1:30 AM, in article
18048858.1178004659748.JavaMail.root@cp1.javalobby.org, "Moutaz"
<moutaz.ahmed@gmail.com> wrote:

> hii
>
> when i add a jar (which i created from another project) to my RCP application
> as "Add External Jar",
> the application sees all the classes and packages in it but when i make an
> instance (object) of any class of this Jar and add it to any view, this RUN
> TIME ERROR MEASSAGE is out in the view where i added to it the object:
>
> "java.lang.NoClassDefFoundError"
Re: Adding a jar to an RCP application [message #467248 is a reply to message #467221] Wed, 02 May 2007 05:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: moutaz.ahmed.gmail.com

hii Alex

the Manifest.mf contains:
////////////////////////////////////////////////
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Dev_Kit Plug-in
Bundle-SymbolicName: Dev_Kit; singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: dev_Kit.Dev_KitPlugin
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.ui.views,
EngNetframeworkPlug_in
Eclipse-AutoStart: true
///////////////////////////////////////////////

the .Classpath contains:

***********************************************
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry path="src" kind="src"/>
<classpathentry path="org.eclipse.jdt.launching.JRE_CONTAINER" kind="con"/>
<classpathentry path="org.eclipse.pde.core.requiredPlugins" kind="con"/>
<classpathentry path="bin" kind="output"/>
</classpath>
***********************************************
Re: Adding a jar to an RCP application [message #467254 is a reply to message #467248] Wed, 02 May 2007 07:13 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
OK, so when I said "You need to add Bundle-Classpath" to the manifest, and you said you tried that, you then posted a manifest without this entry?

So, add:

Bundle-Classpath: foo.jar,.

to your META-INF/MANIFEST.MF

where 'foo.jar' is the name of the Jar in the bundle.

PS EclipseZone needs to have any XML surrounded with (xml) and (/xml) except using square brackets instead of round ones, as otherwise it doesn't get parsed (see the post at http://www.eclipsezone.com/eclipse/forums/m92144309.html#921 44309).

Thanks,

Alex.
Re: Adding a jar to an RCP application [message #467258 is a reply to message #467254] Wed, 02 May 2007 08:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: moutaz.ahmed.gmail.com

hii

thx for ur quick response, but i do that but the same RunTime ERROR "NoClassDefFoundError" is out in the View where i declared it the variable.
Re: Adding a jar to an RCP application [message #467264 is a reply to message #467258] Wed, 02 May 2007 09:30 Go to previous message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
Sorry, can't help any further. You need to post your (correct) manifest.mf as well as your .classpath as I described if you want to get any more help from me.

Alex.
Previous Topic:databinding validates on initial dialog display
Next Topic:RCP app hangs after EXIT_RELAUNCH
Goto Forum:
  


Current Time: Thu Apr 25 08:49:05 GMT 2024

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

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

Back to the top