Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Using RCP and JNI results in NoClassDefFoundError
Using RCP and JNI results in NoClassDefFoundError [message #467515] Fri, 04 May 2007 23:56 Go to next message
Nisha is currently offline NishaFriend
Messages: 2
Registered: July 2009
Junior Member
I know this has been asked before but I haven't been able to find a working solution.

I want to create a RCP application that allows me to use a JNI that we have created. I have .jar and a .dll for that JNI. I created a snippet that I ran as a java application and that was fine. I tried to move it into a one view RCP and it fails (it also fails when I tried to create a plugin and ran the workbench).

It fails with:
java.lang.NoClassDefFoundError: JniDS/JniDSImplement

Whenever it gets to:

jniDS=JniDSImplement.getObj();

I have tried putting it in many places including my dervived classes: WorkbenchAdvisor::preStartup, WorkbenchAdivsor::postStartup, IPlatformRunnable::run, and even in the view createPartControl (though I know that's not where it belongs). I have no problem importing the classes and writing the code - it is all recognized and compiles.

(My project name is RCP_JNI and my package is rcp_jni.)

I have tried:
* loading the dll first with: System.loadLibrary("JniDSDll");
* added the library JniDS.jar in my Properties->Java Build Path->libraries tab
* put the dll in the following directories: eclipse/plugins, RCP_JNI, RCP_JNI/src,
RCP_JNI/src/rcp_jni,RCP_JNI/os/win32/x86, RCP_JNI\bin\rcp_jni,\eclipse\plugins\ws\win32
* added vm arguments in the run configurations to be:
-Djava.library.path=<workspace>RCP_JNI;<workspace>
* imported the JniDS package in the dependencies tab of my plugin.xml

I couldn't see anything obvious to add to my .classpath because I already had:
<classpathentry kind="lib" path="JniDS.jar"/>
and was unable to figure out a way to explicitly add the dll.

I also added
<classpathentry exported="true" kind="lib" path="os/win32/x86" sourcepath="os/win32/x86"/>

Any and all help is greatly appreciated.

-- Nisha
Re: Using RCP and JNI results in NoClassDefFoundError [message #467533 is a reply to message #467515] Sat, 05 May 2007 09:53 Go to previous message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
If you're posting via EZ, you need to surround your code with (xml) and (/xml), but using [] instead of (), to preserve the XML. Otherwise it gets eaten and no-one knows what you've added.

(PS it does show you how to do that on the right-hand side of the posting guidelines)

Alex.
Previous Topic:IAction: the chosen operation is currently not available
Next Topic:Offline/online/synchronization
Goto Forum:
  


Current Time: Mon Nov 12 18:29:45 GMT 2018

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

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

Back to the top