java - Gradle compiling android.jar error -> It is recommended that the compiler be upgraded -


i'm compiling gradlew assemblerelease in linux server console (no visual interface available).

when compiling error shown lot of times:

err:it recommended compiler upgraded. err:warning: /users/mo/documents/android-sdk/platforms/android-22/android.jar(android/text/spannablestring.class): major version 51 newer 50, highest major version supported compiler. 

it means must update java installed on server? how can done command line in linux machine?

thanks

afaik major version means java version. java 7 51, java 6 50. code written java 7, guess? make error go away, suppose should following:

  1. update java 7 system package manager (you may wanna here , here idea how it). in general, need perform yum install java-1.7.*-openjdk newer version, in cases things bit more difficult. didn't tell linux using, so..

  2. add build.gradle:

    compileoptions { sourcecompatibility javaversion.version_1_7 targetcompatibility javaversion.version_1_7 }

and make sure $java_home points new java version. that's it.


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -