As in Java 9, some native APIs were removed for obsolescence, I could not find alternative solutions to replace them. I am a C ++ developer, with little experience in Java. The native APIs I use are: JVM_LoadClass0 , JVM_AllocateNewObject and JVM_AllocateNewArray .
My Java source code:
protected Class resolveClass(MercObjectStreamClass v) throws IOException, ClassNotFoundException { String name = v.getName(); try {
And then the native code is a simple call to JVM_LoadClass0:
JNIEXPORT jclass JNICALL Java_mercio_MercObjectInputStream_loadClass0(JNIEnv * env, jobject this, jclass curClass, jstring currClassName) { return JVM_LoadClass0(env, this, curClass, currClassName); }
The native part is similar to other APIs.
Can anyone suggest an alternative to this approach?
java c ++ c jvm java-9
istik
source share