forked from oculix-org/SikuliX1
-
Notifications
You must be signed in to change notification settings - Fork 4
Headless Mode
JmerAuchan edited this page Apr 1, 2026
·
1 revision
Running scripts from the command line (
-rmode) without the IDE GUI now works reliably.
java -jar oculixide-3.0.1-complete-win.jar -r script.py
# → UnsatisfiedLinkError: 'long org.opencv.core.Mat.n_Mat()'In SikuliX and early OculiX, the -r mode crashed because:
- OpenCV native library was never loaded (name mismatch + silent failure)
-
SikulixIDE.showAfterStart()was called even without a GUI -
resetBeforeScriptStart()threw errors in non-IDE context
| Problem | Fix |
|---|---|
Core.NATIVE_LIBRARY_NAME returned opencv_java454 but DLL is opencv_java4100
|
Updated Core.java to match Apertix 4.10.0 |
loadOpenCV() set libOpenCVloaded = true even on failure |
Only true on success, with 3-stage fallback |
Apertix nu.pattern.OpenCV.loadLocally() never called |
Now the primary loading method |
// Before: always called, crashed in -r mode
SikulixIDE.showAfterStart();
// After: only in IDE mode
if (!Commons.hasOption(RUN)) {
SikulixIDE.showAfterStart();
}# Before: crashed if resetBeforeScriptStart() unavailable
resetBeforeScriptStart()
# After: safe fallback
try:
resetBeforeScriptStart()
except:
passmain() → initOptions → SikulixIDE.start()
→ ... IDE initialization ...
→ Finder2 static {} → Commons.loadOpenCV() (lazy, on first find)
main() → initOptions → Commons.hasOption(RUN)
→ Commons.loadOpenCV() ← explicit, early
→ Runner.runScripts(scripts) ← execute and exit
→ RunTime.terminate(exitCode)
# Run a Jython script headless
java -jar oculixide-3.0.1-complete-win.jar -r path/to/script.py
# With arguments passed to the script
java -jar oculixide-3.0.1-complete-win.jar -r script.py -- arg1 arg2