I have created a jar file witch uses autohotkey.dll
library. Jar runs smoothly on my main pc and laptop, but now I'm trying to use it on pc that has freshly installed windows 10 and I'm getting this error:
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load library 'AutoHotkey': Can't obtain InputStream for win32-x86-64/AutoHotkey.dll at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:271) at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:398) at com.sun.jna.Library$Handler.(Library.java:147) at com.sun.jna.Native.loadLibrary(Native.java:412) at com.sun.jna.Native.loadLibrary(Native.java:391) at DllController.(DllController.java:26) at UI.main(UI.java:113)
DLL file is located in the same folder as the jar file.
I have tried the following:
- Using both 32 and 64-bit versions of JRE
- Installed visual c++ redistributable package (both 32 and 64 bit)
- Also tried running the jar by the following command:
java "-Djava.library.path=C:\runnablegui\new" -jar C:\runnablegui\new\as.jar
Screenshot from Process Monitor involving the Autohotkey.dll operations:
"-Djava.library.path= C:\runnablegui"
should be"-Djava.library.path=C:\runnablegui"
- also, double check the folder structure on a working machine (it seems that dll should be in a sub-folder). – Elliott Frisch