I\'m using the runtime to run command prompt commands from my Java program. However, I\'m not aware of how I can get the output the command returns.
Here is my code:
If you write on Kotlin, you can use:
val firstProcess = ProcessBuilder("echo","hello world").start() val firstError = firstProcess.errorStream.readBytes().decodeToString() val firstResult = firstProcess.inputStream.readBytes().decodeToString()