CodePudding user response:
Now a great god all don't go to CSDNCodePudding user response:
I also encountered the same problems, seems to be no see have a direct release of JNA APICodePudding user response:
NativeLibrary instance=NativeLibrary. GetInstance (StaticConstant. EDI_MIDDLEWARE_DLL);The instance. GetFunction (" initial_DM "). The invoke (new Object [] {});
The instance. GetFunction (" gen_edi2carrier "). InvokeDouble (new Object [] {Java, jobD});
The instance. The dispose ();
CodePudding user response:
This kind of question yourself check the official documenthttps://docs.oracle.com/javase/8/docs/technotes/guides/jni/spec/invocation.html#JNI_OnUnload
From the official documentation
The VM calls JNI_OnUnload The when The class loader containing The native library is garbage collected.
That is to say, don't you hand release, when load the DLL class class loader be garbage collected automatically when released,
So, want to hand release, then their release class loader
Refer to the following link example
https://web.archive.org/web/20140704120535/http://www.codethesis.com/blog/unload-java-jni-dll