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

后端 未结 10 813
野的像风
野的像风 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 17:02

    Even if you're using Linux the solution remains the same.

    Inside the root folder of your Project(Working Directory) >>

    gradle/wrapper/
    

    There's a file named >>

    gradle-wrapper.properties
    

    Change the distributionUrl line (Outdated Version):

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

    To the following distributionUrl (Compatible/Correct Version):

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

    Don't forget to configure IntelliJ IDEA Settings to use the Gradle-Wrapper Configurations.

    0 讨论(0)
  • 2020-12-23 17:04

    I had similar issue with IntelliJ version2018.1.6 x64. I installed Java8 and the problem disappeared.

    0 讨论(0)
  • 2020-12-23 17:06

    Solution summary:

    • Turn back to older version of jdk
    • Remove problematic jdk(s) from intelliJ

    A full demonstration is given below for intelliJ in ubuntu 18.04.1

    fig1: Installing openjdk-8.

    fig2: Adding jdk8 to Project Structure. Click + button then choose JDK. Now choose JDK home path to jdk8. Mine was, as you can see from fig3, /usr/lib/jvm/java-1.8.0-openjdk-amd64

    fig3: openjdk-8 is added to intelliJ. [a:] Time to remove newer versions of jdk from intelliJ.

    fig4: Select 10 (notice that the JDK home path contains java-1.11.0-openjdk-amd64) and press - button to remove 10.

    fig5: after removal of jdk-10 select jdk-8(named 1.8 in fig5) and press ok.

    fig6: Now go to File->Settings->Build, Execution, Deployment->Build tools->Gradle->Gradle JVM and choose the same path that you have set as JDK home path while adding 1.8 in Project Structure and press Ok. Click Build and choose Make new module app and the app module should be created. Now if pressing Run and choosing app module gets your app running, you have a good day :) and if not, recheck activities mentioned in fig3[a] & fig6 once.

    0 讨论(0)
  • 2020-12-23 17:09

    i had to un-install my intelliJ along with cache and all histories, remove my project... Then i re-installed intellij and downloaded my project's fresh version again.

    As a last step, i had to define new sdk for my project. Previously, it was showing 2-3 SDKs. after re-installation, there were none. i added one. To add SDK in Intellij: Go to- File- Project Structure- Project Settings- Project SDK...

    Added one sdk here to point to the jdk installed path.

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