Recent JNI regression
Marco Trudel
mtrudel@gmx.ch
Wed Feb 7 10:40:00 GMT 2007
Hey all
Somewhere after rev 121'200, a JNI regression has slipped in. I now work
with rev 121'646. I saw that Tom committed a JNI fix after my revision,
but don't think that the problems are correlated. But of course I might
be wrong...
So, this problem now is that static initializers of classes with native
methods seem to no longer be called or be called to late.
Please consider the attached example. This output - IMHO - should be
correct:
static initializer 1
static initializer 2
hello
Instead, I get this output:
static initializer 1
Exception in thread "main" java.lang.UnsatisfiedLinkError: printHello
<<No stacktrace available>>
It's not hard to see that I ran this on Windows. But it fails on Linux
too (I'm just too lazy to copy over the error from there). If I put the
System.loadLibrary() call into the main class, it works.
Anyone remembers a patch which might have broken this?
thanks
Marco
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: NativeClass.java
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20070207/a2980068/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: RunTest.java
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20070207/a2980068/attachment-0001.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: NativeClass.c
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20070207/a2980068/attachment.c>
More information about the Java-patches
mailing list