Run set-env-java-home only if necessary
Merge pull request #27 from brugidou/COOK-2083

Run set-env-java-home only if necessary