I am trying to execute a .jar file from a PHP script using the exec() command, more exactly using: 

```
<?php

    $command = 'java -jar myfile.jar';

    exec( $command, $output);

?>

```

both the php script, and the jar are in the same directory on the server. The myfile.jar produces an excel spreadsheet, and I want this spreadsheet to be created or stored in the same directory or another directory for that matter on the server. When I execute myfile.jar in the terminal of my pc, the program works fine and outputs the file to the directory where the .jar is located.

Any ideas?

Best Regards.