Java Addon V8 Repack ((top)) Site

// Call JS function from Java runtime.executeVoidScript("function multiply(a, b) return a * b; "); Object multiplyResult = runtime.executeJSFunction("multiply", 12, 7); System.out.println("12*7 = " + multiplyResult);

JNIEXPORT jbyteArray JNICALL Java_com_v8_repack_V8Repack_repackScript( JNIEnv* env, jobject obj, jlong handle, jbyteArray script, jobject dependencies) java addon v8 repack

// Get script string jsize script_len = env->GetArrayLength(script); jbyte* script_bytes = env->GetByteArrayElements(script, nullptr); std::string script_str(reinterpret_cast<char*>(script_bytes), script_len); env->ReleaseByteArrayElements(script, script_bytes, JNI_ABORT); // Call JS function from Java runtime

Did this answer your question? Thanks for the feedback! Contact us as support@pintomind.com if you still need help. There was a problem submitting your feedback. Please try again later.