Refactors setenv.sh java opts for extensibility