I need 1.7 for a library which uses diamond operators.
I followed these sO answers...but no joy.
From gradle build
compileSdkVersion 19 buildToolsVersion '19.0.3' compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } defaultConfig { minSdkVersion 10 targetSdkVersion 19 versionCode 22 versionName "1.3.1" }
Error: Execution failed for task ':MyApp:compileDefaultFlavorDebugJava'.
invalid source release: 1.7
Java home is set : $ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.7.0_25.jdk/Contents/Home
check your JVM versions. It should not be 1.6.
./gradlew --version javac -version
on OSX check your $JAVA_HOME
echo $JAVA_HOME
You can set your JAVA_HOME
environment variable in ~/.bash_profile
JDK:
/Library/Java/JavaVirtualMachines/jdk1.7.0_60.jdk/Contents/Home/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With