MCPcopy Create free account
hub / github.com/async-profiler/async-profiler / startJvm

Function startJvm

test/test/nonjava/non_java_app.cpp:131–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void startJvm() {
132 JavaVMInitArgs vm_args;
133 JavaVMOption options[1];
134
135 options[0].optionString = const_cast<char*>("-Djava.class.path=build/test/classes");
136 //options[1].optionString = const_cast<char*>("-Xcheck:jni");
137
138 // Configure JVM
139 vm_args.version = JNI_VERSION_1_6;
140 vm_args.nOptions = 1;
141 vm_args.options = options;
142 vm_args.ignoreUnrecognized = true;
143
144 CreateJvm createJvm = (CreateJvm)dlsym(_jvm_lib, "JNI_CreateJavaVM");
145 if (createJvm == NULL) {
146 std::cerr << "Unable to find: JNI_CreateJavaVM" << std::endl;
147 exit(1);
148 }
149
150 // Create the JVM
151 jint rc = createJvm(&_jvm, (void**)&_env, &vm_args);
152 if (rc != JNI_OK) {
153 std::cerr << "Failed to create JVM" << std::endl;
154 exit(1);
155 }
156}
157
158void executeJvmTask() {
159 jclass customClass = _env->FindClass("test/nonjava/JavaClass");

Callers 4

testFlow1Function · 0.85
testFlow2Function · 0.85
testFlow3Function · 0.85
jvmThreadWrapperFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected