JNI callback and jar

M

Mic

Hi all,

I have been dragged with this problem for 3 days... I wrote
a JNI bridge function that does call back to a function
inside a callback class. The java application is archieved
in a jar fiile...

location -
caller in jar: one\two\three\caller.class
callback in jar: one\two\three\callback.class

To be able to callback at the JNI, FindClass need to locate
the callback class... so the class name is passed by using
its "full qualified" name, as I thought...

"one.two.three.callback"

However, FindClass returns NoClassDefFoundError

I have tried to set the classpath environment...


MiC
 
G

Gordon Beaton

To be able to callback at the JNI, FindClass need to locate
the callback class... so the class name is passed by using
its "full qualified" name, as I thought...

"one.two.three.callback"

However, FindClass returns NoClassDefFoundError

When you invoke FindClass, you need to spell the classname like this:

(*env)->FindClass(env,"one/two/three/callback")

i.e. don't use dots like in your example.

This can only be a guess. Next time, post real code!

/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

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top