It is very convenient to use nvm to manage node version. would you like to know if java has any similar tools to switch jdk version?
Jenv, it works very well. Address:http://jenv.io/
jenv use java 1.6.0_45
This is the way to switch jdk versions.
Usage: jenv <command> <candidate> [version] commands: all list <candidate> <version> install <candidate> [version] uninstall <candidate> <version> use <candidate> [version] default <candidate> [version] current <candidate> help repoupdate selfupdate eg: jenv install maven 3.2.1
The above is the general usage, read basically understand, very simple.