What's the right content-type for a Java jar file?
Asked Answered
P

4

9

I'm uploading some jars into s3 and want to set the right content-type headers for them.

I looked through what I thought was a comprehensive list, and was unable to find any mention of jar.

Panta answered 10/6, 2017 at 2:20 Comment(0)
P
3

Oh, wikipedia says it's application/java-archive though I don't see that in any rfc or standards document.

Panta answered 10/6, 2017 at 3:3 Comment(2)
It can also not be found in IANA's media-type registryHangchow
Weirdly enough, you can find OSGi's JAR file extension which specifies 2. File extension(s) : .jarRelentless
E
13

I found a list which might be very useful to some.

You can find a more complete (but still incomplete) list of MIME-Types here from the official Mozilla Developers Network.

For Java Archive (JAR) .jar files the correct type is indeed:

.jar   |   application/java-archive
Exceptional answered 17/5, 2018 at 8:30 Comment(1)
Oddly this "complete list of MIME-Types" is specifically titled "Incomplete list of MIME types."Panta
T
4

I have seen instances of these content-type headers for JAR files:

application/java-archive

application/x-java-archive

application/x-jar

Thingumajig answered 2/9, 2019 at 15:16 Comment(0)
P
3

Oh, wikipedia says it's application/java-archive though I don't see that in any rfc or standards document.

Panta answered 10/6, 2017 at 3:3 Comment(2)
It can also not be found in IANA's media-type registryHangchow
Weirdly enough, you can find OSGi's JAR file extension which specifies 2. File extension(s) : .jarRelentless
Y
0

In my /etc/mime.types file on Fedora Core 19 it is:

application/x-java-archive

On Fedora Core 40 in the /etc/mime.types file:

application/java-archive

So it has changed over the years.

In your original link: iana

It lists it as application/java-archive

Yasminyasmine answered 20/6 at 14:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.