noclass.java 440 B

1234567891011121314151617181920212223242526
  1. // Test to make sure JNI implementation catches exceptions.
  2. public class noclass
  3. {
  4. static
  5. {
  6. System.loadLibrary ("noclass");
  7. }
  8. public static native void find_it ();
  9. public static void main (String[] args)
  10. {
  11. try
  12. {
  13. find_it ();
  14. }
  15. catch (Throwable _)
  16. {
  17. // If find_it() causes a crash, or doesn't throw an exception,
  18. // we won't be running this next line.
  19. System.out.println ("Ok");
  20. }
  21. }
  22. }