[javac] warning: [options] source value 1.5 is obsolete and will be removed in a future release
and
error: strings in switch are not supported in -source 1.5
[javac] switch (xmlData[i][1]) {
[javac] ^
[javac] (use -source 7 or higher to enable strings in switch)
I am getting warnings and errors that I am running Java 1.5 when compiling an APK with Cordova for Android. I can't use strings in switch statements. (the compilation process errors)
My system is 64-bit Windows 7. My Cordova version is 3.5. I am using git-scm. (http://git-scm.com/)
cordova run android --release.C:\Program Files\Java\jdk1.8.0_20 as the Java directory.java -version gives me java version "1.8.0_20".javac -version gives me javac 1.8.0_20.=android-19, =debug, or =release.android:minSdkVersion is always set to "14", everywhere.android:targetSdkVersion is always set to "19", everywhere.How can I force Cordova to run Java 8?
To fix for command line builds, add these lines (or set appropriate values if already present) to your ant build.xml property file (for example if using Android SDK, it's in ${sdk.dir}/tools/ant/build.xml):
<property name="java.target" value="1.7" />
<property name="java.source" value="1.7" />
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