0

I am trying to build android source code in my Linux machine(Ubuntu 12.04 64bit). when I am start building it...i am getting error as follows

============================================ 
Checking build tools versions... 
************************************************************ 
You are attempting to build with the incorrect version of java.   
Your version is: java version "1.6.0_24". The correct version is: Java SE 1.6.   
Please follow the machine setup instructions at 
https://source.android.com/source/download.html 
************************************************************ 
build/core/main.mk:141: *** stop.  Stop.

I am able to understand the problem but I don't know how to change my java version because while installing jdk from terminal i am getting "1.6.0_24" version by default. Please do needful. Thanks In advance.

2 Answers 2

4

Install Java SE 1.6 and use sudo update-alternatives --config java to set to that java version. You can download Java from here http://www.oracle.com/technetwork/java/javase/downloads/index.html

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for the suggestion Charan...apart from changing the alternative, i had to install other build tools as well...
4

1.) If you’ve already installed OpenJDK (Or in ubantu generally it is already installed). Remove it by running this command: sudo apt-get purge openjdk*

2.) Then:

sudo add-apt-repository ppa:webupd8team/java

Then update:

sudo apt-get update

3.) Select which version you want To install Oracle Java 8:

sudo apt-get install oracle-java8-installer

To install Oracle Java 7:

sudo apt-get install oracle-java7-installer

To install the Java 6:

sudo apt-get install oracle-java6-installer

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.