Kotlin could not find the required JDK tools in the Java installation

前端 未结 5 1701
面向向阳花
面向向阳花 2020-12-20 11:11

When running ./gradlew clean build I get following message:

> Task :compileKotlin FAILED

FAILURE: Build failed with an exception.

* What we         


        
5条回答
  •  无人及你
    2020-12-20 11:40

    > Kotlin could not find the required JDK tools in the Java installation '/usr/lib/jvm/java-8-openjdk-amd64/jre' used by Gradle. Make sure Gradle is running on a JDK, not JRE.
    

    it's set to /usr/lib/jvm/java-8-openjdk-amd64/jre.

    Should set the JAVA_HOME to /usr/lib/jvm/java-8-openjdk-amd64/

    If your OS is Ubuntu, make suer to install openjdk jdk by sudo apt-get install openjdk-8-jdk

    sudo apt install openjdk-8-jre-headless will install jre, not jdk

提交回复
热议问题