



gradle directory in your HOME_DIRECTORY set =/path_to_jdk_directory. To fix it, we can add in the gradle.property D:\AndroidSelfTrainingProject\CustomBuildIdDemo>gradle -v Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)Ĭheck the gradle version. Java(TM) SE Runtime Environment (build 1.8.0_91-b14) I already set the correct location to JDK.Ĭheck the java version D:\AndroidSelfTrainingProject\CustomBuildIdDemo>java -version In Android Studio open: File > Project Structure > see if JDK location `compileSdkVersion 'android-24' requires JDK 1.8 or later to compile.` Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

I was also running into the same issue from the command line on my Windows, it shows the same hint. Hopefully this helps if anyone else is running into the same issue from the command line. To fix, I just deleted the line from gradle.properties. =-XX:MaxPermSize=512m -XX:-UseSplitVerifier -Xms512m -Xm圆144m =/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home Did a little digging, and found that it was indeed overridden in my gradle.properties file even though it was showing Java 8 when I executed gradle -version: =true JVM: 1.8.0_92 (Oracle Corporation 25.92-b14)Īt this point, I still hadn't found the source of the problem. Then check which version of Java that Gradle is using: $ gradle -version Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode) Java(TM) SE Runtime Environment (build 1.8.0_92-b14) To track down where it is getting overridden first check java from the command line: $ java -version I was also running into the same issue from the command line on my Mac, but the answer was that JAVA_HOME was getting overridden.
