Not sure why the above is needed for ```get_mem_opts``` to work but I agree with the ordering regardless.

So I propose the following implementation. Given that the following environment variables are set:

```
export JAVA_OPTS="-Dx=JavaOpts -Dy=123"
export SBT_OPTS=-Dx=SbtOpts
export ACTIVATOR_OPTS=-Dx=ActOpts
```
the input to the Java command should be:
```
-Dx=ActOpts -Dx=SbtOpts -DxJavaOpts -Dy=123
```
Agreed?