Static linking of JNI code - HOW?

Tom Tromey tromey@redhat.com
Tue Jun 10 01:39:00 GMT 2003


>>>>> "Craig" == Craig A Vanderborgh <craigv@voxware.com> writes:

Craig> The test program was created with:
Craig>  arm-wince-pe-gcj -fjni --main=HelloWorld HelloWorld.java \
Craig>  helloworld.o -lgcj -lgcc -lc -lwinsock -lcoredll

Craig> where "helloworld.o" (lowercase) contains the native call.
Craig> What to we have to do to get JNI to work with static linking??

Something like that should work.  However:

* make sure that the required JNI function really ends up in the
  executable (it probably does)

* JNI still relies on being able to look up symbols in the
  executable.  This is probably the problem you're running into.
  You'd have to debug to make sure.  One workaround would be to use
  RegisterNatives.

Tom



More information about the Java mailing list