I need to run a Java program that is on my server, for example Teste.java
and return the console output resulting from the execution, be it an error, or a phrase like Olá Mundo!
, using PHP.
I already used commands like exec("java Teste", $output)
and system("java Teste", $output)
, and could actually execute the program, but could never return the console output that this program generated.
Is there any way to do this program execution, and return the output of it?