My XML layout is not rendering with this error message. I am already using Java 8.
XML
Also using latest build tools in Gradle.
and
From the docs: https://developer.android.com/studio/intro/studio-config.html#file_location
STUDIO_JDK: set the JDK with which to run Studio
I prefer using the STUDIO_JDK variable and leave other default java home variables alone.