Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
    http://source.android.com/source/download.html

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
add comment

2 Answers 2

Please have a look at update-java-alternatives.

share|improve this answer
add comment
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
add comment

Your Answer

 
discard

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.