java.lang.UnsatisfiedLinkError while calling native function

S

sonijindal

Hi,

I have a shared library that I am trying to load, but i am getting
java.lang.UnsatisfiedLinkError when it is trying to call the native
function.

One thing I noticed was the weird header file name. The name of the
package which contains the .java file is com.motorola.stv . But when I
am doing javah , the .h file which is created is by the name
com_0002fmotorola_0002fstv_0002fStvUaMgr.h . I am not sure why the name
contains those numbers. I am using j2sdk1.4.2_12.

I was wondering if anyone could help.

Thanks,
Sonika
 
G

Gordon Beaton

One thing I noticed was the weird header file name. The name of the
package which contains the .java file is com.motorola.stv . But when I
am doing javah , the .h file which is created is by the name
com_0002fmotorola_0002fstv_0002fStvUaMgr.h . I am not sure why the name
contains those numbers. I am using j2sdk1.4.2_12.

I appears that an incorrect javah command was used to generate the
file, using slash (/) to separate components instead of dot (.).

Run javah like this, specifying the fully-qualified classname:

javah com.motorola.stv.StvUaMgr

Then make sure the method names in the C source match those in the
generated header file.

/gordon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top