How to remove the binary format already installed by openjdk-7

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?

1

2 Answers

The trouble's fixed, steps I performed:

  1. sudo rm /var/lib/binfmts/jar
  2. Remove the package jayatana from Ubuntu software center.
  3. 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 autoremove
  4. Purge config files:

    dpkg -l | grep ^rc | awk '{print($2)}' | xargs sudo apt-get -y purge
  5. Remove Java config and cache directory:

    sudo bash -c 'ls -d /home/*/.java' | xargs sudo rm -rf
  6. Remove manually installed JVMs:

    sudo rm -rf /usr/lib/jvm/*
  7. sudo apt-get update

  8. Reboot
  9. Re-install the oracle-java6:

    sudo apt-get install oracle-java6-installer

Reference: How to completely uninstall Java?

2

Running this command did it for me:

sudo update-binfmts --package openjdk-7 --remove jar /usr/bin/jexec
sudo dpkg-reconfigure openjdk-13-jre-headless

See .

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like