Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

while building android filesystem, i am getting an error as

You are attempting to build with the incorrect version
of javac.

Your version is: javac 1.7.0_12-ea.
The correct version is: 1.6.

Please follow the machine setup instructions at

but i am having the version of 1.6 only.

$ java -version 
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)

actually i was having java 1.7, then after seeing this error i just installed java 1.6 amd removed java 1.7. but till now it is pointing to java 1.7. What will i do hereafter ? please guide me. Thank u in advance.

share|improve this question

Please have a look at update-java-alternatives.

share|improve this answer
up vote 0 down vote accepted

I used the following command and changed the version needed:

do following:

sudo update-alternatives --config java

This command will display all versions of java you have.

It will ask selection number as following:

Press enter to keep the current choice[*], or type selection number: 

type the version what u want.

It is used to rectify my problem.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.