SamVerschueren / gulp-cordova-build-android

Gulp plugin for building an android Cordova project
MIT License
14 stars 10 forks source link

Specify -source #9

Closed ghost closed 8 years ago

ghost commented 9 years ago
error: strings in switch are not supported in -source 1.6
                switch (action) {
                       ^
  (use -source 7 or higher to enable strings in switch)

I have a plugin that I wrote and want to use JDK 8, how can I configure that option in gulp-cordova-build-android?

SamVerschueren commented 9 years ago

Hi @robertbaker

I can't seem to find documentation regarding the source flag. Isn't cordova just using the default active JDK?

What does the command java -version returns?

ghost commented 9 years ago

I would think it use the jdk. Maybe it's a jdk arg where it's in compat mode by default. I'll look at the android and jdk docs

On Mon, Sep 14, 2015, 11:14 PM Sam Verschueren notifications@github.com wrote:

Hi @robertbaker https://github.com/robertbaker

I can't seem to find documentation regarding the source flag. Isn't cordova just using the default active JDK?

What does the command java -version returns?

— Reply to this email directly or view it on GitHub https://github.com/SamVerschueren/gulp-cordova-build-android/issues/9#issuecomment-140291013 .

SamVerschueren commented 9 years ago

And what is your active java version at the moment?

ghost commented 9 years ago

1.8.60 or something, I use the latest 8 jdk. It seems to be the java compiler error.

Explains why Cordova plugins from apache use a long if else branch in the execute method instead of a switch like I did. I converted it to a if else chain so I can compile and move on.

On Mon, Sep 14, 2015, 11:30 PM Sam Verschueren notifications@github.com wrote:

And what is your active java version at the moment?

— Reply to this email directly or view it on GitHub https://github.com/SamVerschueren/gulp-cordova-build-android/issues/9#issuecomment-140293245 .

SamVerschueren commented 9 years ago

Maybe try to set it in Android Studio first and test if it works?

SamVerschueren commented 8 years ago

Closing this due to lack of activity. If someone else comes up with the same issue, let us know.