Platform: Ubuntu 15.04.
During building android 4.4.2_r1/ or phablet, it's stopped by the message:
"You are attempting to build with the incorrect version of java. Your version is: Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar . The correct version is: Java SE 1.6." Output:
$ make j 4 ..................................................................................................................................................
Checking build tools versions...
You are attempting to build with the incorrect version of java. Your version is: Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar .
The correct version is: Java SE 1.6.
build/core/main.mk:168: *** stop. Stop.
I already remove/ uninstall all the openjdk, but everytime check java version, the output is
$ java -version
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
java version "1.6.0_45"
Java(TM) SE Runtime Environment (build 1.6.0_45-b06)
Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)
If reinstalling the oracle-java6:
sudo apt-get install --reinstall oracle-java6-installer
during the progress, I'm noticed with the message:
"update-binfmts: warning: current package is oracle-java6, but binary format already installed by openjdk-7"
If apply "sudo dpkg --list | grep -i jdk", the output:
:~$ sudo dpkg --list | grep -i jdk
ii oracle-java6-installer 6u45-0~webupd8~8 all Oracle Java(TM) Development Kit (JDK) 6
rc oracle-java7-installer 7u80+7u60arm-0~webupd8~0 all Oracle Java(TM) Development Kit (JDK) 7
I think, may the "binary format already installed by openjdk-7" remain existing be the cause.
So, the question is: how to remove the binary format, which already installed by openjdk-7?
12 Answers
The trouble's fixed, steps I performed:
sudo rm /var/lib/binfmts/jar- Remove the package
jayatanafrom Ubuntu software center. Remove all the Java related packages (Sun, Oracle, OpenJDK, IcedTea plugins, GIJ):
sudo apt-get update apt-cache search java | awk '{print($1)}' | grep -E -e '^(ia32-)?(sun|oracle)-java' -e '^openjdk-' -e '^icedtea' -e '^(default|gcj)-j(re|dk)' -e '^gcj-(.*)-j(re|dk)' -e 'java-common' | xargs sudo apt-get -y remove sudo apt-get -y autoremovePurge config files:
dpkg -l | grep ^rc | awk '{print($2)}' | xargs sudo apt-get -y purgeRemove Java config and cache directory:
sudo bash -c 'ls -d /home/*/.java' | xargs sudo rm -rfRemove manually installed JVMs:
sudo rm -rf /usr/lib/jvm/*sudo apt-get update- Reboot
Re-install the oracle-java6:
sudo apt-get install oracle-java6-installer
Reference: How to completely uninstall Java?
2Running this command did it for me:
sudo update-binfmts --package openjdk-7 --remove jar /usr/bin/jexec
sudo dpkg-reconfigure openjdk-13-jre-headlessSee .