I'm trying to execute java by using shell script through the php's `exec` function

```
<?php
  exec("./test.sh", $output, $exit_code);

  foreach($output as $key => $val){
    echo $key . " ". $val . "<br/>";
  }

  echo "exit code " . $exit_code;
?>

```

Here my script `test.sh` is the following

```
echo "Hello world!";
java -version;
ls -l; 
pwd; 

```

Here is the result where the output exit\_code of `exec` is equal to 0

```
0 Hello world!
1 total 18468
2 drwxrwxr-x 4 leonzo leonzo 4096 mars 22 06:45 assets
3 drwxrwxr-x 2 leonzo leonzo 4096 mars 22 06:45 backup
4 drwxrwxr-x 2 leonzo leonzo 4096 mars 22 06:57 com
5 drwxrwxr-x 2 leonzo leonzo 4096 mars 22 06:45 content
6 -rw-rw-r-- 1 leonzo leonzo 1096 mars 22 06:45 index.php
7 drwxrwxr-x 2 leonzo leonzo 4096 mars 22 06:57 mcd
8 -rw-rw-r-- 1 leonzo leonzo 153 mars 23 14:58 test_jar.php
9 -rw-rw-r-- 1 leonzo leonzo 152 mars 23 14:58 test_jar.php~
10 -rwxrwxrwx 1 leonzo leonzo 129 mars 23 15:08 test.sh
11 -rwxrwxrwx 1 leonzo leonzo 119 mars 23 15:02 test.sh~
12 -rw------- 1 leonzo leonzo 18844395 mars 23 14:45 videcom.jar
13 /home/leonzo/Documents/workspace/quifaitquoi
exit code 0

```

It clean that all command from my shell script have been execute unless java. What is the reason of such a behavior, is there something special to do in order to make java work fine ?

**EDITION**

indeed java is install on my computer

```
>java -version
java version "1.7.0_21"
OpenJDK Runtime Environment (IcedTea 2.3.9) (7u21-2.3.9-0ubuntu0.12.04.1)
OpenJDK 64-Bit Server VM (build 23.7-b01, mixed mode)

```