Accesing the standard out and standard error stream from the Java process
How do I from javascript access the output streams from the started Java process?
4 Replies
An API for this is in our roadmap, but it's not currently available. It can be achieved by observing the changes to the
console
element where all the output is written.
This was discussed here: https://discord.com/channels/988743885121548329/1103695759779573850/1197282830485569606We use this technique for our JavaFiddle, and the source is available: https://github.com/leaningtech/javafiddle
GitHub
GitHub - leaningtech/javafiddle: Build, run, and share Java snippet...
Build, run, and share Java snippets in the browser - GitHub - leaningtech/javafiddle: Build, run, and share Java snippets in the browser
Here's another example of a class that subclasses java.lang.Process and returns System.out as an input stream:
GitHub
SnapCJ/src/snapcj/CJProcess.java at main · reportmill/SnapCJ
A SnapKit adapter for CheerpJ. Contribute to reportmill/SnapCJ development by creating an account on GitHub.