View Issue Details
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0000342||file||General||public||2022-04-25 06:34||2022-04-25 06:34|
|Summary||0000342: jar files with POSIX shell script header do not mention they are JAR files|
|Description||https://github.com/pinterest/ktlint/releases/download/0.45.2/ktlint 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 Reproduce||1. Download https://github.com/pinterest/ktlint/releases/download/0.45.2/ktlint|
2. `file ktlint`
|Tags||No tags attached.|