Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.UnsatisfiedLinkError due to System Language #1115

Open
Berikai opened this issue Feb 16, 2023 · 3 comments
Open

java.lang.UnsatisfiedLinkError due to System Language #1115

Berikai opened this issue Feb 16, 2023 · 3 comments
Assignees

Comments

@Berikai
Copy link

Berikai commented Feb 16, 2023

Exception in thread "main" java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:61)
Caused by: java.lang.UnsatisfiedLinkError: no conscrypt_openjdk_jni-wındows-x86_64 in java.library.path: C:\Program Files\Java\jdk-17\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Program Files\Microsoft\jdk-17.0.6.10-hotspot\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Users\Berkay\AppData\Local\Microsoft\WindowsApps;C:\Users\Berkay\AppData\Roaming\npm;.
        at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2429)
        at java.base/java.lang.Runtime.loadLibrary0(Runtime.java:818)
        at java.base/java.lang.System.loadLibrary(System.java:1989)
        at org.conscrypt.NativeLibraryUtil.loadLibrary(NativeLibraryUtil.java:54)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:568)
        at org.conscrypt.NativeLibraryLoader$1.run(NativeLibraryLoader.java:297)
        at org.conscrypt.NativeLibraryLoader$1.run(NativeLibraryLoader.java:289)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
        at org.conscrypt.NativeLibraryLoader.loadLibraryFromHelperClassloader(NativeLibraryLoader.java:289)
        at org.conscrypt.NativeLibraryLoader.loadLibrary(NativeLibraryLoader.java:262)
        at org.conscrypt.NativeLibraryLoader.load(NativeLibraryLoader.java:162)
        at org.conscrypt.NativeLibraryLoader.loadFirstAvailable(NativeLibraryLoader.java:106)

As you can see, Caused by: java.lang.UnsatisfiedLinkError: no conscrypt_openjdk_jni-wındows-x86_64 this should be written as conscrypt_openjdk_jni-windows-x86_64 (with i, not ı)

This issue appears when my system locale is Turkish. I tested this in both Linux and Windows operating systems. It doesn't appear when system locale is English (United States).

@kruton
Copy link
Contributor

kruton commented Feb 16, 2023

Yes, that's a bug. For those addressing it, it might be worth adding an custom errorprone check to make sure toLowerCase() is not used without a locale argument. I believe PMD already has that kind of check.

@Berikai
Copy link
Author

Berikai commented Feb 19, 2023

Thanks for the clarification.

I've solved my problem by calling Locale.setDefault(Locale) method.

Locale.setDefault(new Locale("en", "US"));

For those who want to achieve this with non-programmatic way can set user.country user.language properties of JVM. It can be passed as arguments like below example.

-Duser.country=US -Duser.language=en

@Berikai Berikai closed this as completed Feb 19, 2023
@prbprbprb
Copy link
Collaborator

prbprbprb commented Feb 20, 2023

Ironically this looks like it's due to the HostProperties class for the OpenJDK build, which is intended to normalise machine/arch consistently with Maven osdetector plugin, is locale-unaware in several places.

Definite bug.

@prbprbprb prbprbprb reopened this Feb 20, 2023
@prbprbprb prbprbprb self-assigned this Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants