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 #467517] Fri, 04 May 2007 23:58
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
Previous Topic:bundle dependencies?
Next Topic:IAction: the chosen operation is currently not available
Goto Forum:
  


Current Time: Tue Nov 20 14:06:34 GMT 2018

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

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

Back to the top