IntelliJ Gradle Plugin: The supplied javaHome seems to be invalid

前端 未结 14 641
暗喜
暗喜 2020-12-23 08:41

Similar to:
- Intellij 14 the supplied javaHome seems to be invalid
- Android Studio - supplied javaHome is not a valid folder

However, I am trying to use

相关标签:
14条回答
  • 2020-12-23 09:16

    IDEA comes in 2 versions: 32bit and 64bit.

    Your JAVA_HOME is 64bit version of Java so you have to run 64bit version of the IDEA ...\IntelliJ\IntelliJ IDEA Community Edition 14.1.2\bin\idea64.exe.

    Otherwise, you can provide 32bit JDK or tweak the behaviour with IDEA settings https://intellij-support.jetbrains.com/hc/en-us/articles/206544879-Selecting-the-JDK-version-the-IDE-will-run-under

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

    UPDATE I believe this issue has been fixed as of 14.1.3

    Related bug links:

    • Intellij 14.1 cannot Import correctly Module with Gradle

    That said, I was able to get by using @Sergii Pechenizkyi's answer; however, it seems like this problem has a few different solutions.

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

    On OSX 10.12.x, Intellij v16.3, I had to go into:

    1. ~/Library/Preferences/IntelliJIdea2016.3
    2. Create a file called: idea.jdk
    3. Add the following to it: /Library/Java/JavaVirtualMachines/jdk1.8.0_65.jdk (or whatever JDK you have installed

    This was a fix I've had to do in v16 of Intellij found on jetbrains site. At one point I had to remove it, on the upgrade to 16.3 I had to add it back. https://intellij-support.jetbrains.com/hc/en-us/articles/206544879-Selecting-the-JDK-version-the-IDE-will-run-under

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

    After trying all above solution nothing worked for me. Then i looked whether the "Use project jdk" path for java is correct. To look it under File->settings->gradle-> gradle jvm I found that jdk got updated and gradle was using old jdk version. So, solution was to update Project jdk path for java in intellij. File->project structure->Platform setting->SDK, here update your right jdk path. thus the problem got solved for me.

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

    In my case the answers above didn't work. Here's what work for me: I needed to change Gradle JVM to point to the actual JDK:

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

    It is not working on the Mac as of 16.3. The SDK was set correctly in Project Settings and the Gradle dialog box no longer allows you to select the JDK. The only solution that worked was creating the gradle.properties file.

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