# Processing.py sound library causing Java errors?

**URL:** <https://discourse.processing.org/t/processing-py-sound-library-causing-java-errors/38954>\
**Category:** Processing.py\
**Created:** [September 24, 2022, 12:23am UTC](https://discourse.processing.org/t/processing-py-sound-library-causing-java-errors/38954 "2022-09-24T00:23:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amb](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@amb](https://discourse.processing.org/u/amb)\
**Post date:** [September 24, 2022, 12:23am UTC](https://discourse.processing.org/t/processing-py-sound-library-causing-java-errors/38954/1 "2022-09-24T00:23:16Z")

</div>

_Setup: Windows 10 / Processing 4.0.1 / Python Mode for Processing 4 4001 / Sound 2.3.1_

I’ve been trying unsuccessfully to use the Sound library in Python mode.  
This sketch just tries to load the sound library and call setup and draw:

```auto
add_library("sound")

def setup():
    print('setup')

def draw():
    print('draw')

```

Trying to run this gives me much Java unhappiness (see below). Any suggestions?  
Thanks!  
–amb

```auto
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._pyx17.f$0(soundTest.pyde:6)
	at org.python.pycode._pyx17.call_function(soundTest.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._pyx16.f$0(C:/Users/ambro/Documents/Processing/soundTest/soundTest.pyde:96)
	at org.python.pycode._pyx16.call_function(C:/Users/ambro/Documents/Processing/soundTest/soundTest.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)

```

---

<div class="post-metadata">

**Author:** ![tabreturn](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tabreturn/32/3697_2.png) [@tabreturn](https://discourse.processing.org/u/tabreturn)\
**Post date:** [September 24, 2022, 1:33am UTC](https://discourse.processing.org/t/processing-py-sound-library-causing-java-errors/38954/2 "2022-09-24T01:33:26Z")

</div>

Welcome, @amb – have you tried Processing 3.5.4 instead?

---

<div class="post-metadata">

**Author:** ![amb](https://avatars.discourse-cdn.com/v4/letter/a/e36b37/32.png) [@amb](https://discourse.processing.org/u/amb)\
**Post date:** [September 24, 2022, 1:48am UTC](https://discourse.processing.org/t/processing-py-sound-library-causing-java-errors/38954/3 "2022-09-24T01:48:58Z")

</div>

Thanks @tabreturn that fixed it!  
Using Processing 3.5.4 / Python Mode for Processing 3 3063 / Sound 2.3.1 works!
