ClassNotFoundException, Attempting to run Processing 4 Code

Appoligies if this is out of scope for the intended use case. For school, I've been tasked with writing some coding in Processing. I would like an easy way to share the code with my classmates, with them being able to use and interact with it in the browser. The porting of the code to something like p5.js isn't exactly light work hence me finding Cheerp. Regardless, I've managed to get it vanilla Processing working pretty well locally, even compiling to a jar, bundled with all assets. Because of this bundling, the file size is ~2.3GB. Attached is the HAR and the console log. Also attached is my current config for CheerpJ, along with a demo of me being able to run the jar via java -jar. Also I've attached a screenshot of the current project structure. There are a few direct jar deps. If you have any questions or need any further info just let me know :). Thanks for y'all work and the support.
2 Replies
Panini
Panini4d ago
Hey, did you check that the sketch.jar file is in the correct location so it can be accessed properly? In your index file, you’re using it like this: cheerpjRunJar("/app/sketch/sketch.jar"); But from the screenshot it looks like the path should be this: cheerpjRunJar("/app/web-port/sketch/sketch.jar"); Also, keep in mind that CheerpJ uses range requests to fetch resources like JAR files. Since you mentioned the JAR is over 2GB in size, that exceeds the limit for HTTP byte ranges (2GB). Is it possible for you to split the content into multiple smaller JARs instead of bundling everything into one? Lastly, I noticed the screenshots also show some JOGL JARs. These rely on native components, which unfortunately cannot run in the browser.
jenny
jennyOP3d ago
Ahh i see thank you! I needed to allow the option to support java 17 to get past the intial hurdle. From there, i think its safe to say that the JOGL JARs are to blame, as even with a simple test jar there seem to be some NPEs in relation to the graphics library. From there the HTTP byte range was also to blame for the issue with the intial jar (http servers returns a 404 if too large). So, it looks like i'll have to come up with some other solution. Thanks again for the help!

Did you find this page helpful?