Reputation: 39
I am using the jni4net to bridge a .net dll to java. It is working fine with in the Java8 environment. Unfortunately, with java 8 I am getting the following error:
I have tried to compile generated jvm with java-11, but still the same problem.
Can't bind bridge:Can't initialize proxy java.lang.System
Can't bind bridge:net.sf.jni4net.jni.JNIException: Can't initialize proxy
java.lang.System ---> System.Reflection.TargetInvocationException: Ein
Aufrufziel hat einen Ausnahmefehler verursacht. ---> java.lang.LinkageError:
runFinalizersOnExit
bei net.sf.jni4net.jni.JNIEnv.ExceptionTest()
bei net.sf.jni4net.jni.JNIEnv.GetStaticMethodID(Class clazz, String name,
String sig)
bei java.lang.System.InitJNI(JNIEnv __env, Class __class)
--- Ende der internen Ausnahmestapelüberwachung ---
bei System.RuntimeMethodHandle.InvokeMethod(Object target, Object[]
arguments, Signature sig, Boolean constructor)
bei System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj,
Object[] parameters, Object[] arguments)
bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags
invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
bei System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
bei net.sf.jni4net.utils.Registry.RegisterStaticAndMethods(RegistryRecord
record, JNIEnv env)
--- Ende der internen Ausnahmestapelüberwachung ---
bei net.sf.jni4net.utils.Registry.RegisterStaticAndMethods(RegistryRecord
record, JNIEnv env)
bei net.sf.jni4net.utils.Registry.BindJvm(RegistryRecord record, ClassLoader
classLoader, JNIEnv env)
bei net.sf.jni4net.utils.Registry.BindJvm(RegistryRecord record, JNIEnv env)
bei net.sf.jni4net.utils.Registry.RegisterType(Type type, Boolean bindJVM,
JNIEnv env)
bei net.sf.jni4net.utils.Registry.RegisterAssembly(Assembly assembly,
Boolean bindJVM)
bei net.sf.jni4net.Bridge.RegisterAssembly(Assembly assembly)
bei net.sf.jni4net.Bridge.BindCore(JNIEnv env, BridgeSetup newSetup)
bei net.sf.jni4net.Bridge.initDotNetImpl(IntPtr envi, IntPtr clazz)
Can't initialize jni4net BridgeC
Upvotes: 3
Views: 3447
Reputation: 1
As a temporary solution you can use ProcessBuilder
and define in it environment the JAVA_HOME
variable with the path to java 8.
Upvotes: 0