vmj is a version manager for Java, that allows to quickly switch between your installed Java versions and to download and setup for you different JREs and JDKs.
For more info visit https://vmj.francescosorge.com/
- Globally install vmj via npm:
npm i -g vmj
- Launch command
vmj
-
Change your JAVA_HOME variable to point to:
your/home/folder/.vmj/java
-
Change your env variable PATH to point to:
your/home/folder/.vmj/java/bin
-
A reboot may be required depending on your OS in order to refresh the system's enviroment variables.