IntelliJ IDEA “The selected directory is not a valid home for JDK”

后端 未结 11 1256
梦如初夏
梦如初夏 2020-12-05 12:19

I just installed IntelliJ IDEA and I\'m trying to set it up. I\'ve gotten to the part where I need to select my home directory for my JDK.

I tried navigating to my J

相关标签:
11条回答
  • 2020-12-05 12:56

    It got this error because I had managed to clobber jdk1.8.0_60 with the jre!

    0 讨论(0)
  • 2020-12-05 12:57

    For Windows, apparently the JDK has to be under C:\Program Files.

    This does not work:

    C:\dev\Java\jdk1.8.0_191     
    

    This works:

    C:\Program Files\Java\jdk1.8.0_191     
    

    (I'm using IntelliJ IDEA Ultimate 2018.2.4.)

    0 讨论(0)
  • 2020-12-05 13:01

    for me ,with JDK11 and IntelliJ 2016.3 , I kept getting the same message so I decided to uninstall JDK11 and installed JDK8 instead and it immediately worked!

    0 讨论(0)
  • 2020-12-05 13:03

    In case you missed the configuration at the Project Structure(File -> Project Structure), just reconfigure it like below:

    For Java

    For Android

    Enjoy coding J

    0 讨论(0)
  • 2020-12-05 13:05

    I had \bin as part of the path. Up one level of the selected directory worked for me.

    0 讨论(0)
  • 2020-12-05 13:09

    I had the same issue. But I figured it out by choosing this path:

    First at all, you need to select the C:\ folder. Then, you select Program Files. After it, you select java, and finally the jdk you downloaded. In my case, I downloaded the JDK1.8.0_60 version.

    To resume the path:

    C:\Program Files\java\jdk1.8.0_60
    

    After you are done with it, you can click on the button next. Then you select the create project from templates. This will create a java application with a main() method. After it, you click next to create the name of you project.

    I hope this helps you.

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