Setup Java like a Pro

Posted by ChenRiang on November 28, 2020


SDKMAN! (formerly known as GVM- Groovy enVironment Manager) is a tool for managing parallel versions of multiple SDK on Unix environment. It will become extreme handy when you need to test your Java application with different Java version and distribution.

Although I don’t need an environment with multiple Java version, but being a lazy developer, setting up java environment just too much work for me. too much

We are going to set up our development in WSL with:

  • Java 1.8
  • Maven 3.6.3

Install SDKMAN!

  1. Launch wsl terminal and execute following command to install SDKMAN!.

     curl -s "" | bash
  2. Open a new terminal or refresh the terminal with following command.

     source ~/.bashrc
  3. Check SDKMAN! version to validate.

     sdk v

Install Java

  1. List all the available Java in SDKMAN!.
     sdk l java

    List all available Java

  2. Install the Java. (In my case I will use 8.0.275.hs-adpt)
     sdk i java 8.0.275.hs-adpt
  3. Done.

Install Maven

  1. List all the available Maven in SDKMAN!.
     sdk l maven
  2. Install Maven.
     sdk i maven 3.6.3
  3. Done.