dcsimg
Packaging JNI LIbraries
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Chris_B
Posted On:   Tuesday, February 12, 2002 02:07 AM

I have a DLL and a native class that I want to distribute in a JAR package. The first question is, is it possible to have the VM load my DLL from inside of the JAR file? I have built the native java class and declared it as: package com.xxxx.yyyy; public class zzzz I have then compiled it using Javac with the -d option to create the file comxxxxyyyyzzzz.class. I have run Javah from the base of the tree and created the H file called com_xxxx_yyyy_zzzz.h. This has the fully qualified stubs in it. The DLL builds fine - and then the fun starts. I build my test program using javac -classpath . and I run it using java -classpath . with the DLL   More>>

I have a DLL and a native class that I want to distribute in a JAR package. The first question is, is it possible to have the VM load my DLL from inside of the JAR file?


I have built the native java class and declared it as:


			
package com.xxxx.yyyy;
public class zzzz


I have then compiled it using Javac with the -d option to create the file comxxxxyyyyzzzz.class.


I have run Javah from the base of the tree and created the H file called com_xxxx_yyyy_zzzz.h. This has the fully qualified stubs in it.


The DLL builds fine - and then the fun starts. I build my test program using javac -classpath . and I run it using java -classpath . with the DLL in the same directory as the test program. This works. If I package up the native class into a JAR and put it in the ext directory under the JRE, then it compiles but at run time I get an unsatisfiedLinkError.


Can't seem to get past this, and I have no idea how to get it to load the DLL from inside the JAR if this is even possible.


Any Clues?


Chris B

   <<Less
About | Sitemap | Contact