1 #include <jni.h> 2 3 /* 4 * Class: sun_jvm_hotspot_utilities_soql_JSJavaScriptEngine 5 * Method: getEveryoneModule 6 * Signature: ()Ljava/lang/Module; 7 * 8 * Get EVERYONE_MODULE from java.lang.Module to open all packages 9 * in jdk.hotspot.agent 10 */ 11 JNIEXPORT jobject JNICALL Java_sun_jvm_hotspot_utilities_soql_JSJavaScriptEngine_getEveryoneModule(JNIEnv *env, jclass this_cls){ 12 jclass module_cls; 13 jfieldID everyone_module_field; 14 15 module_cls = (*env)->FindClass(env, "java/lang/Module"); 16 everyone_module_field = (*env)->GetStaticFieldID(env, 17 module_cls, 18 "EVERYONE_MODULE", 19 "Ljava/lang/Module;"); 20 return (*env)->GetStaticObjectField(env, module_cls, everyone_module_field); 21 }