View Issue Details

IDProjectCategoryView StatusLast Update
0000342fileGeneralpublic2022-04-25 06:34
Reporterjayvdb Assigned To 
Status newResolutionopen 
Product Version5.41 
Summary0000342: jar files with POSIX shell script header do not mention they are JAR files
Description is an example of a JAR file with a POSIX shell script header, which looks like


JV=$(java -version 2>&1 | head -1 | cut -d'"' -f2 | sed '/^1\./s///' | cut -d'.' -f1)

X=$( [ "$JV" -ge "16" ] && echo "--add-opens java.base/java.lang=ALL-UNNAMED" || echo "")

exec java $X -Xmx512m -jar "$0" "$@"


The java executable can run it as a jar file directly. i.e. the following prints the help on all platforms

java -jar /path/to/ktlint --help

The file command says it is "POSIX shell script executable (binary data)"

When I manually remove the script header, file then reports it as "Zip archive data, at least v1.0 to extract, compression method=deflate"

It would be great if it could mention that it is a JAR or ZIP file, perhaps like

"POSIX shell script executable (JAR ..)" or "POSIX shell script executable (Zip archive data, ...)"
Steps To Reproduce1. Download
2. `file ktlint`
TagsNo tags attached.


There are no notes attached to this issue.

Issue History

Date Modified Username Field Change
2022-04-25 06:34 jayvdb New Issue