0
am having a problem running a DLL in Java via JNA, the DLL searches for a file that is in the same folder called "propriedades.properties"
, this DLL works normally, but when using JNA it does not find the file. It turns out the JNA runs the DLL elsewhere, not in its source folder ("This is just an assumption on my part"). The code I use is below:
System.setProperty("jna.library.path", "C:\\");
System.setProperty("jna.debug_load", "true");
System.setProperty("jna.debug_load.jna", "true");
DllMicros micros = (DllMicros) Native.loadLibrary("dllmicros", DllMicros.class);
micros.CallSat(_Id, _ConfigVenda, _DadosVendas, _Error);
I activated the debug to try to identify the problem, but it does not give any indication, since the DLL is included normally, anyway I will include it too.
Looking in C:\jnidispatch.dll
Trying (via loadLibrary) jnidispatch
Looking in classpath from sun.misc.Launcher$AppClassLoader@e2f2a for /com/sun/jna/win32-x86/jnidispatch.dll
Found library resource at jar:file:/E:/Desenvolvimento/Workspaces/trunk4.4/dll-test/lib/jna-4.2.1.jar!/com/sun/jna/win32-x86/jnidispatch.dll
Trying C:\Users\Ricardo\AppData\Local\Temp\jna--1433617560\jna2182820279403986556.dll
Found jnidispatch at C:\Users\Ricardo\AppData\Local\Temp\jna--1433617560\jna2182820279403986556.dll
Looking for library 'dllmicros'
Adding paths from jna.library.path: C:\
Trying C:\dllmicros.dll
Found library 'dllmicros' at C:\dllmicros.dll
Ocorreu um erro: O arquivo de propriedades n�o p�de ser carregado! // Este erro é lançado pela DLL que não encontra o arquivo na pasta em que está sendo executada
If anyone has any tips, I’d appreciate it.