What's the correct Maven environment variable name:
I've personally never found it useful to set
What counts is your $PATH environment. Hijacking part of the answer from Danix, all you need is:
mvn script computes
M2_HOME for you anyway for what it's worth.