Allow to use JAVA_OPTS

The switch to using parameters ws to simplify customisation of the script, for example when using two compile on different project.

The second part allow to limit memory at compile and run time.