Hello, I’m trying to embed a Processing sketch onto an HTML page, which uses Java libraries, I’ve been following this guide.
Processing on the web does not support imported libraries, which is probably why the program works perfectly on the IDE but not on my webpage. How do I manually add these libraries to my code? Can I just download them and put them in folders somehow?
This is the part of my code that needs to be replaced:
Further, ProcessingJS is outdated, therefore you should use p5js.
If you provide the java code, resp. processing java sketch you want to convert to js, we could try to help you …
Hi @mnse and thank you for your answer.
So if I convert my Processing code to p5.js I would have to convert the java libraries I wanted to import too? Is there no way to import java libraries into a p5.js program?
Do you really need a BufferedReader?
Isn’t loadStrings() & saveStrings() enough for your sketch?
B/c your Java Mode sketch would be able to run on the web if you stick w/ Processing’s API:
All depends on your code…
P5js and processing java build up a similar framework ie. setup/draw.
But if you want to implement backend logic with java you can use a server-site approach ie. RestAPI calls etc.
But that mean you need an appserver running ie. tomcat.
As said, all depends on your code and what it does … and if you could tell what libraries you want to use for what we can see if there are similar libraries for js…