title: Error "could not fetch model of type 'BasicIdeaProject' using Gradle distribution" in Windows?
body: <p>When I try to open a project by clicking at my build.gradle, I see this message:</p>
  
  <pre><code>Could not fetch model of type 'BasicIdeaProject' using Gradle distribution 
  'http://services.gradle.org/distributions/gradle-1.4-bin.zip'. The supplied 
  javaHome seems to be invalid. I cannot find the java executable. Tried location: 
  C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 12.1\jre\bin\java.exe
  </code></pre>
  
  <p>I think this happens because IntelliJ searches jre at the wrong folder, because in my IntelliJ directory, I have this sctructure: </p>
  
  <pre><code>C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 12.1\jre\jre\bin\java.exe
  </code></pre>
  
  <p>Of course I can move the <strong>...\jre\jre\bin</strong> folder to the <strong>...\jre</strong>, but if I do this, I see this another message, when try openning the project:</p>
  
  <pre><code>Error: could not open `C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 12.1\jre\lib\i386\jvm.cfg'
  </code></pre>
  
  <p>That is, it can't find the lib folder. Again, I can copy the <strong>...\jre\jre\lib</strong> folder to the <strong>...\jre</strong> folder, but already there  is a folder called lib at the ...\jre folder, that contains only the file tools.jar. </p>
  
  <p>So, how can I do IntelliJ to search at right folder?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>This is my <code>JAVA_HOME</code>:</p>
  
  <pre><code>C:\Program Files (x86)\Java\jre7
  </code></pre>