Indeed, the references you found indicate that jexec cannot be used to run normal JARs beginning with “PK”. But these, and nothing else, are what the binfmt is installed for.
https://bugs.openjdk.org/browse/JDK-8176066 indicates jexec is slated for deprecation. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=136993#82 says jarwrapper already catches JAR files with binfmt-misc… and in contrast to jexec it’ll actually work. I think the proper fix is to remove the binfmt-misc registration from openjdk-8 (at least, but it does work in openjdk-17). ** Bug watch added: Debian Bug tracker #136993 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=136993 ** Changed in: openjdk-8 (Ubuntu) Status: New => Confirmed -- You received this bug notification because you are a member of OpenJDK, which is subscribed to openjdk-8 in Ubuntu. https://bugs.launchpad.net/bugs/1775785 Title: bfg-repo-cleaner jar file is not compatible with OpenJDK's `jexec` Status in openjdk-8 package in Ubuntu: Confirmed Bug description: In Debian systems that install OpenJDK, they seem to be setting up jexec as the binfmt interpreter of launching JAR files (/usr/share/binfmts/jar). However when attempting to run BFG's jar file using jexec it fails with "invalid file (bad magic number): Exec format error" error message. Refer to the discussion at bfg-repo-cleaner upstream, it seems to be that the `jexec` check is too strict or something: https://github.com/rtyley/bfg-repo-cleaner/issues/279 Also according to the OpenJDK upstream's JDK6 bug report, `jexec` seems to be never be directly executed by external programs: https://bugs.java.com/bugdatabase/view_bug.do?bug_id=6401361 ## Additional Information ## OS: KDE neon based on Ubuntu 16.04 To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/openjdk-8/+bug/1775785/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~openjdk Post to : openjdk@lists.launchpad.net Unsubscribe : https://launchpad.net/~openjdk More help : https://help.launchpad.net/ListHelp