Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Please help! - .jar added to build path but noClassDefFoundError(When I moved code accross to make a an RCP, now my .jar references fail)
Please help! - .jar added to build path but noClassDefFoundError [message #1442166] Fri, 10 October 2014 18:17 Go to next message
LHXS Mising name is currently offline LHXS Mising nameFriend
Messages: 20
Registered: April 2011
Junior Member
I was so close to getting this working....!!

OK, I built some code that worked in a basic Java project, and added some .jars for doing http connections (using the Apache httpClient libraries). Tested and worked.

I created a fresh RCP project and dragged over all my source. I tried to drag over the .jars (which failed) so I re-added them (using this tutotial http://www.wikihow.com/Add-JARs-to-Project-Build-Paths-in-Eclipse-(Java))

Now the RCP builds and runs alright, but when I click the button that executes my code, I get a NoClassDefFound error as shown below.

Does anyone have any idea what I can do to fix this? I feel like I've tried everything!

Many thanks

Matt
[...error stuff]
!ENTRY org.eclipse.e4.ui.workbench 4 0 2014-10-10 19:15:25.135
!MESSAGE Internal Error
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: org/apache/http/client/methods/HttpUriRequest
at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:62)

[...more error stuff]
Re: Please help! - .jar added to build path but noClassDefFoundError [message #1442788 is a reply to message #1442166] Sat, 11 October 2014 17:32 Go to previous messageGo to next message
LHXS Mising name is currently offline LHXS Mising nameFriend
Messages: 20
Registered: April 2011
Junior Member
OK, a little bit of further info if it can help anyone help me!

I've setup exactly the same project in a normal java project from scratch and it works fine! It's only in my RCP product that I'm getting this error.

Any help? Anyone?? Sad
Re: Please help! - .jar added to build path but noClassDefFoundError [message #1442803 is a reply to message #1442788] Sat, 11 October 2014 18:07 Go to previous messageGo to next message
LHXS Mising name is currently offline LHXS Mising nameFriend
Messages: 20
Registered: April 2011
Junior Member
and a bit of further further info....

I've now created a blank RCP and tried adding my .jars and calling them and I get the same java.lang.NoClassDefFoundError: problem.

So it's certainly something in the difference between a normal java project and the RCP version.

Anyone?

Many thanks
[SOLVED] Re: Please help! - .jar added to build path but noClassDefFoundError [message #1442813 is a reply to message #1442166] Sat, 11 October 2014 18:27 Go to previous message
LHXS Mising name is currently offline LHXS Mising nameFriend
Messages: 20
Registered: April 2011
Junior Member
Best news....

Solved by:
Quote:

Here is how i did it:

Open plug-in.xml
Go to Runtime tab.
Click on 'Add...' button in the Classpath section
Add your external jar

As a result my MANIFEST.MF now has the entry
Bundle-ClassPath: lib/myjar.jar,


The answer was here....
http://www.eclipsezone.com/eclipse/forums/t93996.html
Previous Topic:What's the difference bewa bundle and a reference in classpath?
Next Topic:how to use stickyview
Goto Forum:
  


Current Time: Thu Apr 25 05:20:57 GMT 2024

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

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

Back to the top