When running ./gradlew clean build
I get following message:
> Task :compileKotlin FAILED
FAILURE: Build failed with an exception.
* What we
From the data provided, It is sure that java
is in the environment path. But, It doesn't confirm that JAVA_HOME is set to a JDK directory. Are you sure JAVA_HOME
is not set to /usr/lib/jvm/java-8-openjdk-amd64/jre
instead of /usr/lib/jvm/java-8-openjdk-amd64
or /usr/lib/jvm/default-java
?
Because, If JAVA_HOME
is set, then gradlew will ignore java
binary in the PATH and execute $JAVA_HOME/bin/java
which in turn will be available in System.getProperty("java.home")
which is logged in this exception ( see jarSearchingUtil.Kt )
Otherwise, You can try declaring JAVA_HOME directly in the gradlew file