Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Using 3rd party .jar in my RCP app
Using 3rd party .jar in my RCP app [message #769808] Thu, 22 December 2011 17:49 Go to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 105
Registered: December 2010
Senior Member
I have several 3rd party .jar files I want to use in my RCP app.
I've done a bunch of searches here, but all the help either has invalid links, or the instructions are so old they don't correspond to the current Eclipse environment.

When developing the code, I added the 3rd party .jar files to the classpath, and that works for compile and junit tests.

When I try to run the Product, I get NoClassDefFoundError's for all the 3rd party stuff.

So, just what are the steps needed to have the 3rd party jars included?
Re: Using 3rd party .jar in my RCP app [message #769815 is a reply to message #769808] Thu, 22 December 2011 18:10 Go to previous messageGo to next message
Federico Sellanes is currently offline Federico SellanesFriend
Messages: 71
Registered: November 2011
Member
Hi, i had this issue a few weeks ago.

In the plugin.xml of your product, go to "build" panel, and in the bottom at "extra classpath entries" add the jars

Tell me if you have problems.
Re: Using 3rd party .jar in my RCP app [message #769823 is a reply to message #769815] Thu, 22 December 2011 18:32 Go to previous messageGo to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 105
Registered: December 2010
Senior Member
So, I created a lib folder in my project, copied the .jar files into it, and added them as "extra classpath entries".
Still fails with NoClassDefFoundError.
I checked, and the class it's complaining about is in one of the .jars.

Is there something else I should do?
Re: Using 3rd party .jar in my RCP app [message #769830 is a reply to message #769823] Thu, 22 December 2011 18:54 Go to previous messageGo to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 105
Registered: December 2010
Senior Member
Okay, figured it out.
I also had to go to the "Runtime" tab of the application, and add them to the "Classpath" there.

Well, at least that got me past that problem.
Now, one of my app utility classes can't be found...
Re: Using 3rd party .jar in my RCP app [message #769836 is a reply to message #769830] Thu, 22 December 2011 19:05 Go to previous messageGo to next message
Federico Sellanes is currently offline Federico SellanesFriend
Messages: 71
Registered: November 2011
Member
Yes, sorry what i did :

1-Create another plugin for the jars :
2-add and import the jars to the build path.
3-Now in the plugin.xml of my product plugin, in the dependencies tab, i added the "jars plugin"

This work for me, sorry my last post is wrong




Re: Using 3rd party .jar in my RCP app [message #769837 is a reply to message #769830] Thu, 22 December 2011 19:05 Go to previous messageGo to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 105
Registered: December 2010
Senior Member
Ooooh, this is weird.
I commented out the 2 lines of code that used the class that couldn't be found.
Project-Clean
run eclipse application
Still fails with that class not being found, and the exception starts with the line of code that was commented out!
It seems to be using an old version of the code for some reason???
Huh?
Re: Using 3rd party .jar in my RCP app [message #769840 is a reply to message #769837] Thu, 22 December 2011 19:27 Go to previous messageGo to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 105
Registered: December 2010
Senior Member
PEBKAC error
I hadn't realized that the .log file was just appended to every time you ran, so when I viewed it with the editor, it was always showing the OLDEST error.
I had to scroll WAY down to find the current error, which I can fix.
sigh.
Re: Using 3rd party .jar in my RCP app [message #769845 is a reply to message #769840] Thu, 22 December 2011 19:33 Go to previous messageGo to next message
Federico Sellanes is currently offline Federico SellanesFriend
Messages: 71
Registered: November 2011
Member
Sorry, i provided you the wrong information :

This is your solution :

http://www.vogella.de/articles/EclipseJarToPlugin/article.html

Remember uncheck : Unzip the jar archives into the project

[Updated on: Thu, 22 December 2011 19:34]

Report message to a moderator

Re: Using 3rd party .jar in my RCP app [message #769855 is a reply to message #769845] Thu, 22 December 2011 19:41 Go to previous messageGo to next message
Missing name Mising name is currently offline Missing name Mising nameFriend
Messages: 105
Registered: December 2010
Senior Member
So, WHY do I need to do all that?
Creating a lib dir, moving the .jar files into it, and adding them in the 2 places in the Manifest seems to be working.
Re: Using 3rd party .jar in my RCP app [message #769857 is a reply to message #769855] Thu, 22 December 2011 19:48 Go to previous message
Federico Sellanes is currently offline Federico SellanesFriend
Messages: 71
Registered: November 2011
Member
Only need to create a plugin from existing jars and after that , need to add this plugin to the dependencies of your rcp (plugin.xml)
Previous Topic:Changed View ID, now it never displays
Next Topic:Auto Scrolling of Text
Goto Forum:
  


Current Time: Fri Apr 19 09:44:28 GMT 2024

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

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

Back to the top