UnsatisfiedLinkError in native method when using JNI

I have created a jar file using JNI and loaded the DLL with

static { System.loadLibrary("fwlibj64"); }

When instaling the module I get an “UnsatisfiedLinkError in native method”. I have put the libraries in Ignition/lib and added the following lines to “ignition.conf”. There is no problem loading the library as long as I unload it in shutdown as described in this post. but making a call to a method does it in.

Version 7.9.3 (64-bit)

wrapper.java.classpath.3=lib/Fwlib64.jar
wrapper.java.classpath.4=lib/fwlibj64.dll
 java.lang.UnsatisfiedLinkError: fwlib64.Fwlib64JNI.cnc_allclibhndl3(Ljava/lang/String;II[I)S
 	at fwlib64.Fwlib64JNI.cnc_allclibhndl3(Native Method)
 	at fwlib64.Fwlib64.cnc_allclibhndl3(Fwlib64.java:23)
 	at com.inductiveautomation.ignition.examples.stp.SimpleProviderGatewayHook.getHandle(SimpleProviderGatewayHook.java:177)
 	at com.inductiveautomation.ignition.examples.stp.SimpleProviderGatewayHook.setup(SimpleProviderGatewayHook.java:89)
 	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$LoadedModule.setup(ModuleManagerImpl.java:2187)
 	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.startupModule(ModuleManagerImpl.java:1052)
 	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$2.call(ModuleManagerImpl.java:648)
 	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.executeModuleOperation(ModuleManagerImpl.java:801)
 	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.installModuleInternal(ModuleManagerImpl.java:624)
 	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl.access$900(ModuleManagerImpl.java:134)
 	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$InstallCommand.execute(ModuleManagerImpl.java:1722)
 	at com.inductiveautomation.ignition.gateway.modules.ModuleManagerImpl$Receiver.receiveCall(ModuleManagerImpl.java:1659)
 	at com.inductiveautomation.ignition.gateway.redundancy.QueueableMessageReceiver.receiveCall(QueueableMessageReceiver.java:45)
 	at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl.dispatchMessage(RedundancyManagerImpl.java:739)
 	at com.inductiveautomation.ignition.gateway.redundancy.RedundancyManagerImpl$ExecuteTask.run(RedundancyManagerImpl.java:760)
 	at com.inductiveautomation.ignition.common.execution.impl.BasicExecutionEngine$ThrowableCatchingRunnable.run(BasicExecutionEngine.java:546)
 	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
 	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
 	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
 	at java.lang.Thread.run(Thread.java:748)

I have found the solution to check to see if it is already loaded and if it is to not reload it with code from This guy