After Updating Android Studio from 3.0 to 3.1 My project gradle syncing failed with the following error.
Gradle sync failed: Uninitialized object exists on
As @tech_android already posted in this comment, to solve that problem permanently, go to Module Settings > SDK Location > Use embedded JDK.
>
This will remove dependency on the external Java installation by using the embedded JDK.