Thank you. I see now, after grabbing the source for Java 8 off GitHub. I had already taken to adding `image/png', 'application/pdf', and a few others. This tells me what else I should fill in.
Since you're using JDK 1.8, you're getting the version of JAF
bundled with JDK 1.8. That older version has an older
mimetypes.default file that is missing the entry for PNG.
If you want to use Jakarta Activation 1.2.1, you'll need to add it
to the bootstrap class path so it's loaded before the builtin
version.
Thad Humphries wrote on 1/9/20 8:42 AM:
Although PNG is listed
in activation/src/main/resources/META-INF/mimetypes.default, I
am not getting "image/png" from MimetypesFileTypeMap. Instead
I'm getting "application/octet-stream".
The following code
System.out.printf("Java version %s\n",
System.getProperties().getProperty("java.version"));
System.out.printf("Java vendor %s\n",
System.getProperties().getProperty("java.vm.vendor"));
System.out.printf("Java name %s\n",
System.getProperties().getProperty("java.vm.name"));
MimetypesFileTypeMap mimeMap = new
MimetypesFileTypeMap();
Java vendor Amazon.com Inc.
Java name OpenJDK 64-Bit Server VM
tiff image/tiff
jpg image/jpeg
html text/html
png application/octet-stream
rtf application/rtf
unknown application/octet-stream
I'm using jakarta.activation-api-1.2.1.jar from Maven Central
and OpenJDK 1.8.0_222 from Amazon Corretto.
--
"Hell hath no limits, nor is circumscrib'd
In one self-place; but where we are is hell, And where
hell is, there must we ever be" --Christopher Marlowe, Doctor
Faustus (v. 111-13)
"Hell hath no limits, nor is circumscrib'd In one self-place; but where we are is hell, And where hell is, there must we ever be" --Christopher Marlowe, Doctor Faustus (v. 111-13)