[Native Image] Does not honor LANG
or LC_ALL
and fails to set sun.jnu.encoding
#9879
Open
2 tasks done
Labels
Describe the Issue
I hope I'm in the right place. So please excuse me if I'm wasting your time.
You can find all the code I'm talking about right here: https://github.com/Schaka/janitorr/tree/bazarr-support
Edit: I built some smaller projects to reproduce the issue.
This one works if using Java 23, but the 21 image does not. The shell files inside can be used to try different things.
graalvm-test.zip
This one is a full project to be built with Gradle. I basically just followed a GraalVM blog post.
native-image-error.zip
The image is built using the Spring-Boot
buildBootImage
step via Gradle and I'm passing these ENV variables.The result of the build command is:
I've set the ENV variables both for the image at runtime and at build time in my desperation, but neither seem to make a difference. When starting the resulting container, setting them also does not make a difference.
Yet, the second I use Path.of("a path with an ümläüt"), I run into the following exception:
Is there something I'm missing here, or could this be a bug in GraalVM somehow?
Looking at the code, UnixFileSystem and UnixPath definitely reads
sun.jnu.encoding
.Logging from within the image provides:
Using the latest version of GraalVM can resolve many issues.
GraalVM Version
23
Operating System and Version
Debian 12, Docker
Diagnostic Flag Confirmation
-H:ThrowMissingRegistrationErrors=
flag.Run Command
The default for the image created with paketo builders, completely unchanged.
Expected Behavior
I would expect the encoding to be set correctly so I can use the nio.Path API.
Actual Behavior
Steps to Reproduce
Path.of("/any/directory/with/ümläut")
Additional Context
Important to note:
Even running it like this, with the correct charset parsed, it seems to not work:
No response
Run-Time Log Output and Error Messages
No response
The text was updated successfully, but these errors were encountered: