title: Android Studio shows an error when trying to use Embedded JDK instead of a custom install
body: <p>After I updated to Android Studio 2.3, I haven't been able to use the embedded JDK. When I try to build the project, I get errors like this:</p>
  <pre><code>Error:The newly created daemon process has a different context than expected.
  Java home is different.
  Expecting: 'D:\Development\IDE\AndroidStudio\jre' but was: 'C:\Program Files\Java\jre1.8.0_121'.
  Please configure the JDK to match the expected one.
  &lt;a href=&quot;open.project.structure&quot;&gt;Open JDK Settings&lt;/a&gt;
  </code></pre>
  <p>But the <code>JAVA_HOME</code> environment variable isn't defined, but I can still use the normal JDK any problems, so I don't believe that's a problem. Where does Android Studio find the <code>JAVA_HOME</code> that prevents me from using the embedded JDK?</p>
  <p>I tried uninstalled the system JDK to get it to work, and I updated java, which lead to it pointing to the JRE. I then reinstalled the JDK and when I point to it, it works fine. But I want to use the embedded JDK. Any ideas?</p>
  <p>I have tried setting <code>JAVA_HOME</code> in gradle.properties, as linked in comments, but it still shows the error.</p>
  <p>The line I added was:</p>
  <pre><code>org.gradle.java.home=D:/Development/IDE/AndroidStudio/jre
  </code></pre>
  <p>It should make the embedded JDK work (and change <code>JAVA_HOME</code> in the IDE) but it doesn't. It still leads to the same error mentioned at the top of this post.</p>
  <p>In the snippet  it says jre, and that was because when I copied it, I had just uninstalled the JDK. Updating the JDK and Java resulted in <code>JAVA_HOME</code> being set to the JDK location, but it isn't defined as an environment variable. I tried deleting the JDK table  in Android Studio's config folder, but it did not work.</p>
  <p>And what it looks when I set the JDK to be the embedded:</p>
  <p><a href="https://i.stack.imgur.com/zpMLC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zpMLC.png" alt="Screenshot showing the embedded JDK being enabled" /></a></p>