Importing gradle project in IntelliJ

前端 未结 4 1677
别那么骄傲
别那么骄傲 2020-12-19 07:17

I have IntelliJ 12.0 on and gradle 1.2. on Windows 7. When I try to import a build.gradle file I get the following error message in IntelliJ. I am a bit lost here. Any ideas

相关标签:
4条回答
  • 2020-12-19 07:50

    Though I did not find the root cause where the different javaHomes have been taken from, at least I found a workaround that worked for me:

    Try setting the following in your gradle.properties (either in %USERPROFILE%\.gradle\ or in your project build dir):

    org.gradle.java.home=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.0\jre
    
    0 讨论(0)
  • 2020-12-19 07:54

    my fix: File -> Project Structure -> change the jdk path to not have jre.

    I'm not sure how it got there, but it took me forever to track down. Perhaps because it picked up settings from a previous bad install.

    0 讨论(0)
  • 2020-12-19 08:08

    IntelliJ v15.0.6, same problem.

    I'm using a JRE that's not the one that is built into IntelliJ.

    • I made sure JAVA_HOME was pointing to my JRE, then
    • I deleted "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.6\", then
    • I restarted IntelliJ.

    Now my gradle build scripts work fine from within IntelliJ.

    0 讨论(0)
  • 2020-12-19 08:10

    Looks like it might be fixed in 12.1 or 12 EAP: IDEA-102365, IDEA-89697

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