From b00484014b4c0e468acee3be17dc5df7dafd3565 Mon Sep 17 00:00:00 2001 From: Dylan Chen Date: Tue, 17 Oct 2023 14:41:49 +0800 Subject: [PATCH] Revert "fix" This reverts commit fe6820b1bbc677895a1a8edfadc3bab71d041470. --- src/java_binding/src/lib.rs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/java_binding/src/lib.rs b/src/java_binding/src/lib.rs index aa7e564ed1ace..6edf4d29ce557 100644 --- a/src/java_binding/src/lib.rs +++ b/src/java_binding/src/lib.rs @@ -12,4 +12,18 @@ // See the License for the specific language governing permissions and // limitations under the License. -pub use risingwave_jni_core::*; +#![feature(result_option_inspect)] + +use std::ffi::c_void; + +use jni::sys::{jint, JNI_VERSION_1_2}; +use jni::JavaVM; +use risingwave_jni_core::register_native_method_for_jvm; + +#[no_mangle] +#[allow(non_snake_case)] +pub extern "system" fn JNI_OnLoad(jvm: JavaVM, _reserved: *mut c_void) -> jint { + let _ = register_native_method_for_jvm(&jvm) + .inspect_err(|_e| eprintln!("unable to register native method")); + JNI_VERSION_1_2 +}