Using RCP and JNI results in NoClassDefFoundError [message #467515] |
Fri, 04 May 2007 23:56 |
Nisha 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
|
|
|
|
Powered by
FUDForum. Page generated in 0.04490 seconds