Resolving SDKMAN: JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME

Resolving SDKMAN JAVA_HOME not set Issue

Hello friends. Today we are going to see Resolving SDKMAN: JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME error using one simple command.

Error:

SDKMAN: JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME

Solution:

This issue occurs with Groovy because the JAVA_HOME environment variable is not set. In order to have this resolved easily, we will be using SDKMan and if you havent got it installed in your machine, you can install it by following our article on Installing SDKMan in Ubuntu.

Once you have the SDKMan installed in your machine, just execute the following command in terminal:

sdk install java

This will take care of installing the Java OpenJDK and will also set the JAVA_HOME environment variable.

Related Posts