I am currently using Sikuli which requies both a PATH
and SIKULI_PATH
environment variable to be set in order to execute. Applying this in the run config is fairly straight forward and allows me to run the script as intended from within Eclipse.
Exporting the runnable JAR is working well with everything except UnsatisfiedLinkError
is being thrown which was the same exception I would receive when I didn't have the aforementioned variables set.
Is there a convenient way to export the below settings into the runnable JAR?:
The idea is to essentially generate a stand-alone executable JAR that executes the Sikuli script.
I have attempted to manually set PATH
and SIKULI_HOME
which worked as intended (echo %PATH%
& echo %SIKULI_HOME%
both print the required paths). However I'm still receiving the same UnsatisfiedLinkError
. Below is the relevant StackTrace:
C:\Users\XXXXX\Desktop>java -jar sikuli.jar -Dsikuli.Debug=3 -Djava.library.path = "C:\Program Files (x86)\Sikuli X\"
Exception in thread "main" java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: java.lang.UnsatisfiedLinkError: C:\Program Files (x86)\Sikuli X\libs\Win32Util.dll: Can't find dependent libraries
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(Unknown Source)
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.load0(Unknown Source)
at java.lang.System.load(Unknown Source)
at com.wapmx.nativeutils.jniloader.NativeLoader.loadLibrary(NativeLoader.java:44)
at org.sikuli.script.Win32Util.<clinit>(Win32Util.java:19)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.sikuli.script.Env.getOSUtil(Env.java:91)
at org.sikuli.script.ScreenHighlighter.init(ScreenHighlighter.java:180)
at org.sikuli.script.ScreenHighlighter.<init>(ScreenHighlighter.java:293)
at org.sikuli.script.Screen.initBounds(Screen.java:105)
at org.sikuli.script.Screen.<init>(Screen.java:117)
at org.sikuli.tests.TestSikuli.main(TestSikuli.java:13)