0

I've been trying to get libGDX to work out but i always get a error when gradle's building.

here is the error

Gradle sync failed: The newly created daemon process has a different context than expected.
        It won't be possible to reconnect to this daemon. Context mismatch: 
        Java home is different.
        Wanted: DefaultDaemonContext[uid=null,javaHome=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.3.2\jre,daemonRegistryDir=C:\Users\Shawn\.gradle\daemon,pid=396,idleTimeout=null,daemonOpts=-Xms128m,-Xmx1500m,-Dfile.encoding=windows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]
        Actual: DefaultDaemonContext[uid=be8febdd-0d00-4ec8-98ce-6076e4f5a2eb,javaHome=C:\Program Files\Java\jdk1.8.0_111,daemonRegistryDir=C:\Users\Shawn\.gradle\daemon,pid=9116,idleTimeout=60000,daemonOpts=-Xms128m,-Xmx1500m,-Dfile.encoding=windows-1252,-Duser.country=US,-Duser.language=en,-Duser.variant]
        Consult IDE log for more details (Help | Show Log)

My project Structure Structure

build.gradle file

Java home isn't defined


Solved:

I fixed it by adding a extra line in the gradle.properties file

org.gradle.java.home=C:/Program Files/Java/jdk1.8.0_111
Cœur
  • 37,241
  • 25
  • 195
  • 267
Shawn-Ross
  • 137
  • 2
  • 12

1 Answers1

0

CHANGE YOUR BUILD TOOL

Go to options (ctrl + alt + s) and select tabs like in image, and change JRE to your actual i.e. jdk1.8.0_111 (if you have few options, try to select them and run your app):

enter image description here

IF IT IS NOT WORKING, WE ARE GOING FURTHER :D

Android Studio

  1. Close Android Studio
  2. Go to you Android Studio directory and run studio64.exe instead studio.exe
  3. Check if error still exists.

default dir for Android Studio: C:\Program Files\Android\Android Studio\bin

enter image description here

InteliJ IDEA

same steps, run idea64.exe instead idea.exe

default (my) dir for Android Studio:

C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2016.3\bin

enter image description here

miljon
  • 2,611
  • 1
  • 16
  • 19