IntelliJ/Gradle Could not determine java version from '11.0.1'

后端 未结 8 827
Happy的楠姐
Happy的楠姐 2020-12-09 09:18

I\'m running a Linux Ubuntu 18 OS. Installed jdk in a custom local directory.

Normally, IntelliJ recommends that you use the default gradle wrapper. But

相关标签:
8条回答
  • 2020-12-09 09:35

    Your gradle is too old for that JDK, upgrade your gradle or downgrade you JDK

    0 讨论(0)
  • 2020-12-09 09:36

    Reintalling Intellij Worked for me. You need to uninstall first before reinstall. While uninstalling, ensure to select option to delete older cache and settings

    0 讨论(0)
  • 2020-12-09 09:37

    If you use IntelliJ

    Checks:

    1. Navigate to:

      File >> Settings >> Build, Execution, Deployment >> Build Tools >> Gradle.

      Alongside Gradle JVM: make sure you select the correct version of Java.

    2. Navigate to: Right-Click 'Project Root Directory' & Select Open Module Settings. Project Structure windows shows-up. Make sure your JDK home path is added to the Platform Settings >> SDKs : JDK home path

    3. Still, on the same window Project Structure, select correct SDK relevant to your project under

      Project Settings >> Modules : Module SDK

    4. Fix/Solution: Nvavigate to & open: gradle/wrapper/gradle-wrapper.properties & update the distributionUrl version to the latest version. In my case (at the time of this post), my older version was:

      distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip

      And my latest version is:

      distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-bin.zip

      As shown below:

    5. In your build.gradle file make sure you set:

      sourceCompatibility = 11

    0 讨论(0)
  • 2020-12-09 09:39

    check , maybe you have 2 times gradle in path

    0 讨论(0)
  • 2020-12-09 09:48

    I noticed a subtlety in the way you download the IDE from jetbains.com

    You probably want JBR 8 and not JBR 11. Also, make sure your JDK is setup properly with jbsdk bintray downloader plugin.

    0 讨论(0)
  • 2020-12-09 09:53

    If you are using the latest version of intellijIdea.

    In my case, 2019.1 -version

    Delete the directory idea's jdk

    then RESTART idea.

    for detail see this pic

    Hope this is working for you !

    In chinese:

    (If you can't read chinese,you needn't to read this.All you need to know have typed above already)

    如果你是用最新版本的intellijidea.由于intellijidea默认安装了11的java。而且就算你输入java -verison,告诉你是java8,在ide里面也配置了java 8 idea还是告诉你这个错误。

    只有通过删除idea自己下载java11版本,可以解决这个问题。直接删除应用包下的jdk文件夹,重启idea就可以。如下图。

    0 讨论(0)
提交回复
热议问题