← Back to team overview

sikuli-driver team mailing list archive

[Question #179872]: Script Error-when runs .py file "Run as jython"

 

New question #179872 on Sikuli:
https://answers.launchpad.net/sikuli/+question/179872

I have come across a error when I am trying to run the follwing python script

import sys
print sys.path
from sikuli.Sikuli import *
print sys.path


Following error is shown when this script runs on jython 2.5.2
I am using Eclipse 3.6



['D:\\projects\\prj-parameters\\Coding\\workspace1\\eBA\\src', 'D:\\projects\\prj-parameters\\Coding\\workspace1\\eBA\\src', 'C:\\Program Files\\Sikuli X\\sikuli-script.jar', 'D:\\projects\\prj-parameters\\Coding\\eclipseconf\\dropins\\PyDev 2.2.4\\plugins\\org.python.pydev_2.2.4.2011110216\\PySrc', 'C:\\jython2.5.2\\Lib', 'C:\\jython2.5.2\\Lib\\site-packages', 'D:\\tools\\com\\sun\\java\\jdk\\1.5.0_16\\jre\\lib\\rt.jar', 'D:\\tools\\com\\sun\\java\\jdk\\1.5.0_16\\jre\\lib\\jsse.jar', 'D:\\tools\\com\\sun\\java\\jdk\\1.5.0_16\\jre\\lib\\jce.jar', 'D:\\tools\\com\\sun\\java\\jdk\\1.5.0_16\\jre\\lib\\charsets.jar', 'D:\\tools\\com\\sun\\java\\jdk\\1.5.0_16\\jre\\lib\\ext\\dnsns.jar', 'D:\\tools\\com\\sun\\java\\jdk\\1.5.0_16\\jre\\lib\\ext\\localedata.jar', 'D:\\tools\\com\\sun\\java\\jdk\\1.5.0_16\\jre\\lib\\ext\\sunjce_provider.jar', 'D:\\tools\\com\\sun\\java\\jdk\\1.5.0_16\\jre\\lib\\ext\\sunpkcs11.jar', '__classpath__', '__pyclasspath__', '__pyclasspath__/']
Traceback (most recent call last):
  File "D:\projects\prj-parameters\Coding\workspace1\eBA\src\Tset1.py", line 3, in <module>
    from sikuli.Sikuli import *
  File "C:\jython2.5.2\Lib\site-packages\sikuli\__init__.py", line 3, in <module>
    from Sikuli import *
  File "C:\jython2.5.2\Lib\site-packages\sikuli\Sikuli.py", line 10, in <module>
    from org.sikuli.script import SikuliScript
java.lang.UnsupportedClassVersionError: Bad version number in .class file

      at java.lang.ClassLoader.defineClass1(Native Method)

      at java.lang.ClassLoader.defineClass(ClassLoader.java:620)

      at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

      at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)

      at java.net.URLClassLoader.access$100(URLClassLoader.java:56)

      at java.net.URLClassLoader$1.run(URLClassLoader.java:195)

      at java.security.AccessController.doPrivileged(Native Method)

      at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

      at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

      at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:268)

      at java.lang.ClassLoader.loadClass(ClassLoader.java:299)

      at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

      at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

      at java.lang.Class.forName0(Native Method)

      at java.lang.Class.forName(Class.java:242)

      at org.python.core.Py.loadAndInitClass(Py.java:895)

      at org.python.core.Py.findClassInternal(Py.java:830)

      at org.python.core.Py.findClass(Py.java:855)

      at org.python.core.JavaImportHelper.isJavaClass(JavaImportHelper.java:182)

      at org.python.core.JavaImportHelper.tryAddPackage(JavaImportHelper.java:41)

      at org.python.core.imp.import_next(imp.java:718)

      at org.python.core.imp.import_name(imp.java:824)

      at org.python.core.imp.importName(imp.java:884)

      at org.python.core.ImportFunction.__call__(__builtin__.java:1220)

      at org.python.core.PyObject.__call__(PyObject.java:357)

      at org.python.core.__builtin__.__import__(__builtin__.java:1173)

      at org.python.core.imp.importFromAs(imp.java:978)

      at org.python.core.imp.importFrom(imp.java:954)

      at sikuli.Sikuli$py.f$0(C:\jython2.5.2\Lib\site-packages\sikuli\Sikuli.py:211)

      at sikuli.Sikuli$py.call_function(C:\jython2.5.2\Lib\site-packages\sikuli\Sikuli.py)

      at org.python.core.PyTableCode.call(PyTableCode.java:165)

      at org.python.core.PyCode.call(PyCode.java:18)

      at org.python.core.imp.createFromCode(imp.java:386)

      at org.python.core.imp.createFromSource(imp.java:349)

      at org.python.core.imp.loadFromSource(imp.java:576)

      at org.python.core.imp.find_module(imp.java:473)

      at org.python.core.PyModule.impAttr(PyModule.java:100)

      at org.python.core.imp.import_next(imp.java:715)

      at org.python.core.imp.import_name(imp.java:824)

      at org.python.core.imp.importName(imp.java:884)

      at org.python.core.ImportFunction.__call__(__builtin__.java:1220)

      at org.python.core.PyObject.__call__(PyObject.java:357)

      at org.python.core.__builtin__.__import__(__builtin__.java:1173)

      at org.python.core.imp.importAll(imp.java:998)

      at sikuli$py.f$0(C:\jython2.5.2\Lib\site-packages\sikuli\__init__.py:3)

      at sikuli$py.call_function(C:\jython2.5.2\Lib\site-packages\sikuli\__init__.py)

      at org.python.core.PyTableCode.call(PyTableCode.java:165)

      at org.python.core.PyCode.call(PyCode.java:18)

      at org.python.core.imp.createFromCode(imp.java:386)

      at org.python.core.imp.createFromSource(imp.java:349)

      at org.python.core.imp.loadFromSource(imp.java:576)

      at org.python.core.imp.find_module(imp.java:473)

      at org.python.core.imp.import_next(imp.java:713)

      at org.python.core.imp.import_name(imp.java:824)

      at org.python.core.imp.importName(imp.java:884)

      at org.python.core.ImportFunction.__call__(__builtin__.java:1220)

      at org.python.core.PyObject.__call__(PyObject.java:357)

      at org.python.core.__builtin__.__import__(__builtin__.java:1173)

      at org.python.core.imp.importAll(imp.java:998)

      at org.python.pycode._pyx0.f$0(D:\projects\prj-parameters\Coding\workspace1\eBA\src\Tset1.py:4)

      at org.python.pycode._pyx0.call_function(D:\projects\prj-parameters\Coding\workspace1\eBA\src\Tset1.py)

      at org.python.core.PyTableCode.call(PyTableCode.java:165)

      at org.python.core.PyCode.call(PyCode.java:18)

      at org.python.core.Py.runCode(Py.java:1261)

      at org.python.util.PythonInterpreter.execfile(PythonInterpreter.java:235)

      at org.python.util.jython.run(jython.java:247)

      at org.python.util.jython.main(jython.java:129)


java.lang.UnsupportedClassVersionError: java.lang.UnsupportedClassVersionError: Bad version number in .class file


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.