[SOLVED] Gradle sync failed

[SOLVED] Gradle sync failed: CreateProcess error=216, This version of %1 is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher  Consult IDE log for more details (Help | Show Log)

The only easy and 100% working solution.
1) Remove ALL insalled JDK and JRE from your computer. (Even updates)
2) Install Latest JDK from here. (JRE will be installed together)
3) Go to Android Studio File -> Project Structure -> SDK Location and remove Embedded JDK
Provide path to latest JDK. (see image)

4) Go to Gradle.properties and change Set Value to Xmx512m or Xmx512m
5) Try again to gradle update. You are all done. :)