init.java 520 B

123456789101112131415161718192021222324252627
  1. // Regression test for JNI and static initializers.
  2. public class init
  3. {
  4. public static class NativeClass
  5. {
  6. static
  7. {
  8. System.out.println("static initializer 2");
  9. System.loadLibrary("init"); // if it's here, this app doesn't work
  10. }
  11. public static native void printHello();
  12. }
  13. static
  14. {
  15. System.out.println("static initializer 1");
  16. }
  17. public static void main(String[] args)
  18. {
  19. //System.loadLibrary("test"); // if it's here, this app works
  20. NativeClass.printHello();
  21. }
  22. }