← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #689767]: addHotkey cannot coerce 3rd argument to HotkeyListener

 

Question #689767 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/689767

Peter Zejda posted a new comment:
Hi RaiMan,

Well, it was a happy accident. For me, the IDE jar file works correct,
but if I set the CLASSPATH to the API jar file, then it fails. So I
guess I can just still to the ID version of the jar file (as a
reasonable workaround for myself).

If interested, here is the output with the CLASSPATH being set back and
forth, and the corresponding results.

C:\Users\Peter Zejda\Google Drive\home\programming\fun\skipads.sikuli>jython temp.py
C:\Users\Peter Zejda\AppData\Roaming\Sikulix\Lib\site-packages
C:\Users\Peter Zejda\AppData\Roaming\Sikulix\Lib
C:\Users\Peter Zejda\Google Drive\home\programming\fun\skipads.sikuli
C:\non-installed\jython2.7.1\bin
C:\non-installed\jython2.7.1\Lib
__classpath__
__pyclasspath__/
C:\non-installed\jython2.7.1\Lib\site-packages

C:\Users\Peter Zejda\Google Drive\home\programming\fun\skipads.sikuli>echo %CLASSPATH%
C:\non-installed\SikulixIDE204\sikulixide-2.0.4.jar

C:\Users\Peter Zejda\Google
Drive\home\programming\fun\skipads.sikuli>set CLASSPATH=C:\non-
installed\SikulixIDE204\api\sikulixapi-2.0.4.jar

C:\Users\Peter Zejda\Google Drive\home\programming\fun\skipads.sikuli>jython temp.py
Traceback (most recent call last):
  File "temp.py", line 2, in <module>
    from sikuli import *
  File "C:\Users\Peter Zejda\AppData\Roaming\Sikulix\Lib\sikuli\__init__.py", line 3, in <module>
    from Sikuli import *
  File "C:\Users\Peter Zejda\AppData\Roaming\Sikulix\Lib\sikuli\Sikuli.py", line 88, in <module>
    import org.sikuli.script.TextRecognizer as JTextOCR
java.lang.NoClassDefFoundError: net/sourceforge/tess4j/ITesseract
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at org.python.core.Py.loadAndInitClass(Py.java:1107)
        at org.python.core.Py.findClassInternal(Py.java:1042)
        at org.python.core.Py.findClassEx(Py.java:1093)
        at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:142)
        at org.python.core.packagecache.PackageManager.findClass(PackageManager.java:33)
        at org.python.core.packagecache.SysPackageManager.findClass(SysPackageManager.java:130)
        at org.python.core.PyJavaPackage.__findattr_ex__(PyJavaPackage.java:134)
        at org.python.core.PyObject.__findattr__(PyObject.java:965)
        at org.python.core.PyObject.impAttr(PyObject.java:1103)
        at org.python.core.imp.import_next(imp.java:840)
        at org.python.core.imp.import_logic(imp.java:905)
        at org.python.core.imp.import_module_level(imp.java:970)
        at org.python.core.imp.importName(imp.java:1057)
        at org.python.core.ImportFunction.__call__(__builtin__.java:1280)
        at org.python.core.PyObject.__call__(PyObject.java:450)
        at org.python.core.__builtin__.__import__(__builtin__.java:1232)
        at org.python.core.imp.importOneAs(imp.java:1093)
        at sikuli.Sikuli$py.f$0(C:/Users/Peter Zejda/AppData/Roaming/Sikulix/Lib/sikuli/Sikuli.py:669)
        at sikuli.Sikuli$py.call_function(C:/Users/Peter Zejda/AppData/Roaming/Sikulix/Lib/sikuli/Sikuli.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:171)
        at org.python.core.PyCode.call(PyCode.java:18)
        at org.python.core.imp.createFromCode(imp.java:436)
        at org.python.core.imp.createFromSource(imp.java:396)
        at org.python.core.imp.loadFromSource(imp.java:664)
        at org.python.core.imp.find_module(imp.java:551)
        at org.python.core.PyModule.impAttr(PyModule.java:111)
        at org.python.core.imp.import_next(imp.java:840)
        at org.python.core.imp.import_module_level(imp.java:957)
        at org.python.core.imp.importName(imp.java:1057)
        at org.python.core.ImportFunction.__call__(__builtin__.java:1280)
        at org.python.core.PyObject.__call__(PyObject.java:450)
        at org.python.core.__builtin__.__import__(__builtin__.java:1232)
        at org.python.core.imp.importAll(imp.java:1176)
        at sikuli$py.f$0(C:/Users/Peter Zejda/AppData/Roaming/Sikulix/Lib/sikuli/__init__.py:3)
        at sikuli$py.call_function(C:/Users/Peter Zejda/AppData/Roaming/Sikulix/Lib/sikuli/__init__.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:171)
        at org.python.core.PyCode.call(PyCode.java:18)
        at org.python.core.imp.createFromCode(imp.java:436)
        at org.python.core.imp.createFromSource(imp.java:396)
        at org.python.core.imp.loadFromSource(imp.java:664)
        at org.python.core.imp.find_module(imp.java:551)
        at org.python.core.imp.import_next(imp.java:838)
        at org.python.core.imp.import_module_level(imp.java:957)
        at org.python.core.imp.importName(imp.java:1057)
        at org.python.core.ImportFunction.__call__(__builtin__.java:1280)
        at org.python.core.PyObject.__call__(PyObject.java:450)
        at org.python.core.__builtin__.__import__(__builtin__.java:1232)
        at org.python.core.imp.importAll(imp.java:1176)
        at org.python.pycode._pyx0.f$0(temp.py:3)
        at org.python.pycode._pyx0.call_function(temp.py)
        at org.python.core.PyTableCode.call(PyTableCode.java:171)
        at org.python.core.PyCode.call(PyCode.java:18)
        at org.python.core.Py.runCode(Py.java:1614)
        at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:296)
        at org.python.util.jython.run(jython.java:362)
        at org.python.util.jython.main(jython.java:142)
Caused by: java.lang.ClassNotFoundException: net.sourceforge.tess4j.ITesseract
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        ... 58 more
java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: net/sourceforge/tess4j/ITesseract

C:\Users\Peter Zejda\Google
Drive\home\programming\fun\skipads.sikuli>set CLASSPATH=C:\non-
installed\SikulixIDE204\sikulixide-2.0.4.jar

C:\Users\Peter Zejda\Google Drive\home\programming\fun\skipads.sikuli>jython temp.py
C:\Users\Peter Zejda\AppData\Roaming\Sikulix\Lib\site-packages
C:\Users\Peter Zejda\AppData\Roaming\Sikulix\Lib
C:\Users\Peter Zejda\Google Drive\home\programming\fun\skipads.sikuli
C:\non-installed\jython2.7.1\bin
C:\non-installed\jython2.7.1\Lib
__classpath__
__pyclasspath__/
C:\non-installed\jython2.7.1\Lib\site-packages

C:\Users\Peter Zejda\Google Drive\home\programming\fun\skipads.sikuli>


For whatever reason, the API jar files seems to have trouble finding the ITesseract class.

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.