package com.cmake.ndk1.jni; public class JNIException { static { System.loadLibrary("exception-lib"); } public native void nativeInvokeJavaException(); public native void nativeThrowException() throws IllegalArgumentException; private int operation() { return 2 / 0; } }
add_library( #动态库名称 exception-lib exception-lib SHARED jni/jni_exception.cpp )