Cordoba is launching the wrong version of Java. How do I get Cordoba to run a specific version of Java?

[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 get warnings and errors when I run Java 1.5 when compiling an APK using Cordova for Android. I cannot use strings in switch statements. (compilation process errors)

My system is 64-bit Windows 7. My version of Cordova is 3.5. I am using git -scm. ( http://git-scm.com/ )

  • I run this command: cordova run android --release.
  • My Java environment variable lists C:\Program Files\Java\jdk1.8.0_20as a Java directory.
  • My environment variable defines the Java path as the first item in the list.
  • Every patch and version of Java is removed, except that I just reinstalled from the Oracle site.
  • I have restarted my computer.
  • java -versiongives me java version "1.8.0_20".
  • javac -versiongives me javac 1.8.0_20.
  • - =android-19, =debug =release.
  • android:minSdkVersion "14", .
  • android:targetSdkVersion "19", .

Java 8?

+3
3

, ( , ) ant build.xml (, Android SDK, ${sdk.dir}/tools/ant/build.xml):

<property name="java.target" value="1.7" />
<property name="java.source" value="1.7" />
+5
  • (Package Explorer) " Android → "
  • " → Java", " " 1.7 1.8 from " ".
  • ()
+1

2 , .
.

npm, , README.md

It works for me, if it is not for you, use problems and call the request functions in the github repository.

+1
source

All Articles