Recent JNI regression

Andrew Haley aph@redhat.com
Wed Feb 7 16:07:00 GMT 2007


Marco Trudel writes:
 > 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.

I have duplicated this problem.

Andrew.



More information about the Java-patches mailing list