I have a jar file that writes something to stdout. I need to execute it from PHP and store what it writes.
public class Main{
public static void main(String[] args) {
System.out.println("Something...");
}
}
Unfortunately the following script
<?php
exec('java -jar Main.jar', $output);
print_r($output);
?>
always shows that $output is an empty Array().
How do I force the output go to PHP?