Processing.py-Bugs icon indicating copy to clipboard operation
Processing.py-Bugs copied to clipboard

error while importing oscP5

Open joachimheintz opened this issue 3 years ago • 5 comments

i have oscP5 installed, and it works in java code. but for any simple code in processing.py, for instance ...

add_library('oscP5') def setup(): size(400,400)

... i get this error: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$AppClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$AppClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap') at jycessing.LibraryImporter.addJarToClassLoader(LibraryImporter.java:315) at jycessing.LibraryImporter.recursivelyAddJarsToClasspath(LibraryImporter.java:164) at jycessing.LibraryImporter.addLibrary(LibraryImporter.java:140) at jycessing.LibraryImporter$1.call(LibraryImporter.java:82) at org.python.core.PyObject.call(PyObject.java:480) at org.python.core.PyObject.call(PyObject.java:484) at org.python.pycode._pyx54.f$0(oscP5_python.pyde:1) at org.python.pycode._pyx54.call_function(oscP5_python.pyde) 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.core.Py.exec(Py.java:1658) at org.python.pycode._pyx53.f$0(/home/jh/sketchbook/oscP5_python/oscP5_python.pyde:96) at org.python.pycode._pyx53.call_function(/home/jh/sketchbook/oscP5_python/oscP5_python.pyde) 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.core.Py.exec(Py.java:1658) at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:276) at jycessing.PAppletJythonDriver.processSketch(PAppletJythonDriver.java:233) at jycessing.PAppletJythonDriver.findSketchMethods(PAppletJythonDriver.java:613) at jycessing.Runner.runSketchBlocking(Runner.java:399) at jycessing.mode.run.SketchRunner.lambda$2(SketchRunner.java:112) at java.base/java.lang.Thread.run(Thread.java:833)

joachimheintz avatar Oct 08 '22 20:10 joachimheintz

i should add: Processing 4.0.1 Debian Linux 11

joachimheintz avatar Oct 08 '22 20:10 joachimheintz

I am seeing the same thing with add_library('pdf'). Question: Is the java runtime used by Processing 4.0.1 included in the download or is it assumed that the host machine already has a jre installed? I do not have one on my Macbook Pro (12.6.1).

baltner avatar Nov 13 '22 17:11 baltner

I got the same error when trying to use the sound library too

ThomasNLy avatar Nov 14 '22 22:11 ThomasNLy

Processing JRE is bundled with Processing. Try Processing 3.5.4 instead.

tabreturn avatar Nov 17 '22 19:11 tabreturn

I got the same error when trying to use the sound library too

Definitely the same error, with sound library too

colpiche avatar Nov 23 '22 15:11 colpiche