public class V8RepackDemo public static void main(String[] args) try (V8 runtime = V8.createV8Runtime("secure_isolate")) // Execute simple JS int result = runtime.executeIntegerScript("(function() return 5 * 8; )();"); System.out.println("5*8 = " + result);
// Return as byte array jbyteArray result_array = env->NewByteArray(result_str.length()); env->SetByteArrayRegion(result_array, 0, result_str.length(), reinterpret_cast<const jbyte*>(result_str.c_str())); java addon v8 repack