Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jni4net with Java 11

Tags:

jni4net

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 
like image 891
aze Avatar asked Feb 27 '26 23:02

aze


1 Answers

I have managed to compile and execute the same with java 11.

Try downloading the JNI4NET libs inside your project.

like image 191
Ajinkya Avatar answered Mar 02 '26 15:03

Ajinkya