Ubuntu 15.04 build Android 5.0 error: You are attempting to build with the incorrect version of java. why? -


error:

============================================ checking build tools versions... ************************************************************ attempting build incorrect version of java.  version is: picked java_tool_options: -javaagent:/usr/share/java/jayatanaag.jar  java version "1.7.0_80" java(tm) se runtime environment (build 1.7.0_80-b15) java hotspot(tm) 64-bit server vm (build 24.80-b11, mixed mode). required version is: "1.7.x"  please follow machine setup instructions @     https://source.android.com/source/initializing.html ************************************************************ build/core/main.mk:174: *** stop.  stop.  #### make failed build targets (1 seconds) #### 

java -version:

$ java -version picked java_tool_options: -javaagent:/usr/share/java/jayatanaag.jar  java version "1.7.0_80" java(tm) se runtime environment (build 1.7.0_80-b15) java hotspot(tm) 64-bit server vm (build 24.80-b11, mixed mode) 

javac -version:

$ javac -version picked java_tool_options: -javaagent:/usr/share/java/jayatanaag.jar  javac 1.7.0_80   $ sudo update-alternatives --config java there 2 choices alternative java (providing /usr/bin/java).    selection    path                                            priority   status ------------------------------------------------------------   0            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      auto mode   1            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      manual mode * 2            /usr/lib/jvm/java-7-oracle/jre/bin/java          1         manual mode  $ sudo update-alternatives --config javac there 2 choices alternative javac (providing /usr/bin/javac).    selection    path                                         priority   status ------------------------------------------------------------   0            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1071      auto mode   1            /usr/lib/jvm/java-7-openjdk-amd64/bin/javac   1071      manual mode * 2            /usr/lib/jvm/java-7-oracle/bin/javac          1         manual mode 

for of want build gingerbread thru kitkat (which requires oracle jdk 1.6) have system configured lollipop (jdk 1.7), here's easiest way update system:

first add ppa updated java builds.

sudo add-apt-repository ppa:webupd8team/java 

then install:

sudo apt-get update && sudo apt-get install oracle-java6-installer 

once completes, need tell linux use older version of java , java compiler render content.

run following 2 commands separately, making correct selection oracle jdk 1.6 both times when prompted. again in terminal:

sudo update-alternatives --config java sudo update-alternatives --config javac 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -