Could not determine Java version using executable C:\Program Files\Java\jdk-10.0.1\bin\java.exe

后端 未结 10 821
野的像风
野的像风 2020-12-23 16:23

Could not determine Java version using executable C:\\Program Files\\Java\\jdk-10.0.1\\bin\\java.exe.

This error appeared when I tried to create a new project in Int

相关标签:
10条回答
  • 2020-12-23 16:44

    Below is what i did to solve this issue on Windows 10 with IntelliJ 2018.1.5 and Java 10.0.1 JDK

    1. Downloaded the new gradle version(latest is 4.8.1 at the time of this post) from: https://gradle.org/releases
    2. Followed the following steps mentioned at: https://gradle.org/install/

    (i) Microsoft Windows users

    Create a new directory C:\Gradle with File Explorer.

    Open a second File Explorer window and go to the directory where the Gradle distribution was downloaded. Double-click the ZIP archive to expose the content. Drag the content folder gradle-4.8.1 to your newly created C:\Gradle folder.

    (ii) Added PATH C:\Gradle\gradle-4.8.1\bin to environment variable

    1. After above went to File --> Settings-->Build Tools --> Gradle and did set Gradle home to C:/Gradle/gradle-4.8.1

    2. Then went to View --> Tool Windows --> Gradle and hit the Refresh all Gradle projects icon.

    0 讨论(0)
  • 2020-12-23 16:44

    Going to:

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

    and selecting:

    Use local gradle distribution
    

    fixed it for me.

    0 讨论(0)
  • 2020-12-23 16:48

    After downloading my latest Gradle version and changing the path environment variable to C:\Gradle\gradle-4.10-bin\gradle-4.10\bin, not what was on the instructions, and changing to "Use local gradle distrubution" under Settings- Build, Execution, Deployment - Gradle It worked for me.

    0 讨论(0)
  • 2020-12-23 16:52

    For JDK 10 you will need Gradle 4.7+ which is not used by default in IntelliJ IDEA (current version IntelliJ IDEA 2018.1.4).

    To fix this issue install latest Gradle for your OS (Install guide). For MacOS you can use Homebrew:

    brew install gradle
    

    Go to your project directory:

    cd ~/path/to/your/project/
    

    Generate Gradle Wrapper script with the version you installed (in my case it is 4.8):

    gradle wrapper --gradle-version 4.8
    

    This command is going to download Gradle 4.8, create scripts gradlew and gradlew.bat for your current project. From this point, you should use these scripts in the command-line.

    Next step, is to make sure that IntelliJ IDEA uses those, instead of built-in Gradle distribution and you can do this by opening IntelliJ preferences and search for "gradle" (this will be in "Build, Execution, Deployment / Build Tools / Gradle").

    In this section of the settings select:

    Select “Use gradle ‘wrapper’ task configuration”

    Apply changes, press ok and re-build (re-sync) Gradle and everything should be fine. I hope this helps.

    0 讨论(0)
  • 2020-12-23 16:53

    It's most likely your gradle version. Gradle 4.7+ has JDK 10 support.

    0 讨论(0)
  • 2020-12-23 16:59

    same in mac == Could not determine Java version using executable /Library/Java/JavaVirtualMachines/jdk-11.0.2.jdk/Contents/Home/bin/java. this help me

    cd /Library/Java/JavaVirtualMachines
    

    then run

    sudo rm -rf jdk-11.0.2.jdk
    

    after that try to build

    it will request SDK select it from Contents

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