I'm trying to add jcharset ([https://www.freeutils.net/source/jcharset/]) to my project, by I couldn't archive it for the last few days. Let's I describe my env:
- spring boot fat jar
- java 17
- docker image gcr.io/distroless/java17-debian12The library working locally but not on environment, because of differences in class loading (https://bugs.java.com/bugdatabase/view_bug.do?bug_id=4619777). For spring boot spring-boot-maven-plugin structure is like this:enter image description here
I can change maven build plugin or something else, but not sure what the right path to add service to META-INF/classes in fat jar.
- java -cp with library - didn't help, it still didn't load library to SystelClassLoader
- add jar with library like /usr/lib/jvm/java-17-openjdk-arm64/lib/jcharset-2.1.jar - not relevant for Java after 9
- use some maven plugin with spring-boot-maven-plugin - didn't help
- Instrumentation api - but looks like I need build the second jar for that