#946759 update-binfmts: warning: current package is openjdk-11, but binary format already installed by openjdk-8

Package:
binfmt-support
Source:
binfmt-support
Description:
Support for extra binary formats
Submitter:
Thorsten Glaser
Date:
2026-01-29 07:53:01 UTC
Severity:
minor
#946759#5
Date:
2019-12-15 11:35:24 UTC
From:
To:
Not sure whether this is a bug in binfmt-support or OpenJDK packaging, but:

update-binfmts: warning: current package is openjdk-11, but binary format already installed by openjdk-8

I used to have OpenJDK 8 installed but then upgraded to OpenJDK 11 and
don’t have 8 installed any more. Should there not have been a handover?

#946759#10
Date:
2025-05-22 21:58:56 UTC
From:
To:
I had the same issue with openjdk-11-jre-headless and openjdk-21-jre-
headless.

There is a wrong word in the openjdk-*-jre-headless prerm:
they check for 
/var/lib/binfmts/openjdk-11
(which never exists) instead of
/var/lib/binfmts/jar
before removing the old /var/lib/binfmts/jar binding.

THe new one called by 
sudo update-binfmts --import
is /usr/share/binfmts/jar
and as the version mismatch between it and the currently registered
/var/lib/binfmts/jar, update-binfmts complains and bails out.

I will reassign the bug to one of the openjdk jre-headless packages.

Cheers,
Alban

current broken prerm scripts.

cat /var/lib/dpkg/info/openjdk-17-jre-headless\:amd64.prerm
#!/bin/sh

set -e

basedir=/usr/lib/jvm/java-17-openjdk-amd64
jre_tools='java jpackage keytool rmiregistry'

if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
    for i in $jre_tools; do
	update-alternatives --remove $i $basedir/bin/$i
    done

    if which update-binfmts >/dev/null; then
	# try to remove and ignore the error
<<<<<<<<<<<<<<<<<<<<<<<<<<<< bug here
	if [ -e /var/lib/binfmts/openjdk-17 ]; then

	    update-binfmts --package openjdk-17 \
		--remove jar /usr/bin/jexec || true
	fi
    fi

    update-alternatives --remove jexec $basedir/lib/jexec
fi



cat /var/lib/dpkg/info/openjdk-11-jre-headless\:amd64.prerm
#!/bin/sh

set -e

basedir=/usr/lib/jvm/java-11-openjdk-amd64
jre_tools='java jjs keytool rmid rmiregistry pack200 unpack200'

if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
    for i in $jre_tools; do
	update-alternatives --remove $i $basedir/bin/$i
    done

    if which update-binfmts >/dev/null; then
	# try to remove and ignore the error
<<<<<<<<<<<<<<<<<<<<<<<<<<<< bug here
	if [ -e /var/lib/binfmts/openjdk-11 ]; then
	    update-binfmts --package openjdk-11 \
		--remove jar /usr/bin/jexec || true
	fi
    fi

    update-alternatives --remove jexec $basedir/lib/jexec

    rm -f $basedir/lib/*/classes.jsa
fi

#946759#17
Date:
2026-01-29 01:47:40 UTC
From:
To:
I have opened a PR against salsa debian openjdk 6 monthes ago, and
pinged them 2 months ago. Is this the wrong way to submit fixes to
debian openjdk packaging?


https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=946759
https://lists.debian.org/debian-user/2014/02/msg00041.html
https://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg1810286.html

Seems jar binfmt upgrade is broken since at least 2014. Thankfully
nearly none of the jar installed on Debian have exec bit set so binfmt
jar is nearly never used. But ditaa CLI requires it. And is used by zim
ditaa plugin. Both are broken after openjdk upgrades as of now. Please
comment on my PR if it is invalid so it can be made ready for merging.

Cheers,
Alban