I installed jdk using the following command: sudo apt-get install default-jdk but it is the wrong version. I need Java SE 1.6 for building Android. When I try building Android, I get a message: 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
How can I uninstall Java version "1.6.0_24" and install Java SE 1.6? I have alien installed so I can install .rpm packages.
Best Answer
1.) If you’ve already installed OpenJDK (Or in Ubuntu generally it is already installed). Remove it by running this command:
2.) Then:
Then update:
3.) Select which version you want To install Oracle Java 8:
To install Oracle Java 7:
To install the Java 6: