JNI and packages

1999-09-14 Thread JB


Hi all. I have created and successfully run a JNI *.so on RH6 but for
one thing.
When I package the java src that contains the native methods, I get an
UnsatifiedLinkerError for the method call. When I try to package it, it
seems to load properly but dies when I call any native methods. The
package name is fine. I thought it may be a namespace issue. Any
pointers would help.

cheers
jb


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: JNI and packages

1999-09-14 Thread JB

Nathan Meyers wrote:
> 
> JB wrote:
> >
> > Hi all. I have created and successfully run a JNI *.so on RH6 but for
> > one thing.
> > When I package the java src that contains the native methods, I get an
> > UnsatifiedLinkerError for the method call. When I try to package it, it
> > seems to load properly but dies when I call any native methods. The
> > package name is fine. I thought it may be a namespace issue. Any
> > pointers would help.
> 
> The name of the native entry point is derived from the full
> package+class+method name. If you rerun javah on your classfile, you'll
> see it's now expecting a different name for the native function.

I tried that and ran a diff against the *.h's with and without the
package declaration and they come out on my machine exactly the same.
Can I assume then that this is not normal? 

"java -version" reports: 
java version "1.2"
Classic VM (build Linux_JDK_1.2_pre-release-v2, native threads, sunwjit)

cheers
jb


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: JNI and packages

1999-09-14 Thread JB

Nathan Meyers wrote:
> 
> Did you specify the right classname (with and without package) in the
> two javah invocations? Did you notice that the two javah invocations
> produced .h files with different names?

Aha! So it's not 'javah MyClass' but 'javah 'org.digart.MyClass'. That
did the trick. Thanks very much for your help.

cheers
jb


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]