How to resolve update-binfmts: warning: current package is oracle-java8, but binary format already installed by openjdk-7

I earlier had Oracle Java 7 installed on my Linux box. I upgraded to Oracle Java 8 as follows (below commands to be typed in a terminal window):
$ sudo apt-get purge oracle-java7-installer <enter>
$ sudo apt-get install oracle-java8-installer <enter>

However, when Oracle Java 8 was downloaded and installed, I saw a message like this:
update-binfmts: warning: current package is oracle-java8, but binary format already installed by openjdk-7

Appears there is some issue in the update-binfmts and it could be listed using:
$ update-binfmts --display <enter>

You will see that the entry shows openjdk-7. To change it and overcome the error message, do the following:
$ sudo update-binfmts --package openjdk-7 --remove jar /usr/bin/jexec <enter>
$ sudo update-binfmts --package oracle-java8 --install jar /usr/bin/jexec --magic PKx03x04 <enter>

That’s all and it should now be okay.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s