When installing Maven, sdkman sets the MAVEN_HOME environment variable. This is probably wrong:
http://stackoverflow.com/questions/17136324/what-is-the-difference-between-m2-home-and-maven-home
Given that Maven 1 is not available for install with sdkman, it would probably be better if the variable was called M2_HOME instead.
Notice however, that the Maven homepage itself doesn't recommend setting an environment variable at all anymore: https://maven.apache.org/install.html (though some traces of M2_HOME remain).
The home environment variable is auto-generated from the candidate's name, and not really used anywhere outside of sdkman itself. It is exposed to the user for the sake of fast access to the current candidate version directory. In other words, you can simply type cd $MAVEN_HOME to get there.
I'd suggest leaving the name of the home folder this way (unless of course it is breaking something).
Hope that makes sense!
Understood.
It still seems like sdkman should be responsible for setting export M2_HOME=$MAVEN_HOME each time the version changes. Otherwise, running mvn will not find the libraries it needs to run.
Just ran into this issue since some programs request the environment variable, it would be nice if SDKMAN handled this properly so I wouldn't have to go out of my way to set it myself
Most helpful comment
It still seems like sdkman should be responsible for setting
export M2_HOME=$MAVEN_HOMEeach time the version changes. Otherwise, runningmvnwill not find the libraries it needs to run.