Script too large to compile

Asked by xyz_User on 2020-03-28

Trying to compile my old code into a runnable JAR file

Receving this error as the scrip is too large I believe:

java.lang.RuntimeException: java.lang.RuntimeException: Encountered too large method code in C:\Users\user7643\AppData\Roaming\Sikulix\SetupStuff\scriptCompiled\ Please provide a CPython 2.7 bytecode file (.pyc) to proceed

What exactly does it mean by please provide a CPythin bytecode?

I did compile the script via: python -m py_compile and have the .pyc file (get auto rename to: automationV1.cpython-38)

What exactly is the next step to compile it now, where do I put this file?

Thank you!

Question information

English Edit question
Sikuli Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
xyz_User (userseven) said : #1

Looks like had python 3 installed, I've compiled it with python 2

but now I'm getting a different error:

[error] JythonSupport: exec: returns: Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\user7643\AppData\Roaming\Sikulix\Lib\", line 50, in compile_dir if not compile_file(fullname, ddir, force, rx, quiet): File "C:\Users\user7643\AppData\Roaming\Sikulix\Lib\", line 99, in compile_file ok = py_compile.compile(fullname, None, dfile, True) File "C:\Users\Humayun\AppData\Roaming\Sikulix\Lib\", line 99, in compile_file ok = py_compile.compile(fullname, None, dfile, True) File "C:\Users\user7643\AppData\Roaming\Sikulix\Lib\", line 96, in compile _py_compile.compile(file, cfile, dfile) File "C:\Users\user7643\AppData\Roaming\Sikulix\Lib\", line 96, in compile _py_compile.compile(file, cfile, dfile) at org.python.compiler.Module.serializePyBytecode(
at org.python.compiler.Module.compile(
at org.python.core.imp.compileSource(
at org.pytho

at org.python.modules._py_compile.compile(
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(
at java.base/java.lang.reflect.Method.invoke(
java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: javax/xml/bind/DatatypeConverter

Best RaiMan (raimund-hocke) said : #2

Not sure, what you are doing.

SikuliX scriptcode has to be compiled with Jython 2.7.

xyz_User (userseven) said : #3

Thanks RaiMan, that solved my question.