Uploaded image for project: 'Maven'
  1. Maven
  2. MNG-7245

Maven doesn't start due to Unicode characters in path to jansi.dll

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.8.2
    • None
    • None
    • None

    Description

      Looks like there is the same issue as MNG-7165 but it's at Windows now.

      >mvn --version
      Failed to load native library:jansi-2.3.4-42a78e9e6c4110f-jansi.dll. osinfo: Windows/x86_64
      java.lang.UnsatisfiedLinkError: C:\Users\��������\AppData\Local\Temp\jansi-2.3.4-42a78e9e6c4110f-jansi.dll: Can't find dependent libraries
      Apache Maven 3.8.2 (ea98e05a04480131370aa0c110b8c54cf726c06f)
      Maven home: C:\Program Files\Apache\Maven
      Java version: 11.0.12, vendor: Microsoft, runtime: C:\Program Files\Microsoft\jdk-11.0.12.7-hotspot
      Default locale: ru_RU, platform encoding: Cp1251
      OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
      
      >java --version
      openjdk 11.0.12 2021-07-20
      OpenJDK Runtime Environment Microsoft-25199 (build 11.0.12+7)
      OpenJDK 64-Bit Server VM Microsoft-25199 (build 11.0.12+7, mixed mode)
      

      Attachments

        Issue Links

          Activity

            rfscholte Robert Scholte added a comment -

            I'm using Windows too. Maybe this is a Locale issue. based on the diamonds-with-questionmarks in the path.

            rfscholte Robert Scholte added a comment - I'm using Windows too. Maybe this is a Locale issue. based on the diamonds-with-questionmarks in the path.
            michael-o Michael Osipov added a comment - - edited

            First of all, diamonds are a girl's best friend. Second, I hate Windows with a passion for this mess in the last 30 years. I wonder whether this is Jansi-specific or Java on Windows...

            michael-o Michael Osipov added a comment - - edited First of all, diamonds are a girl's best friend. Second, I hate Windows with a passion for this mess in the last 30 years. I wonder whether this is Jansi-specific or Java on Windows...
            michael-o Michael Osipov added a comment - Here is the issue: https://github.com/libgdx/libgdx/issues/5524 https://bugs.openjdk.java.net/browse/JDK-8195129
            michael-o Michael Osipov added a comment -

            Maybe rfscholte can try to escalate this with Rory O'Donnell?

            michael-o Michael Osipov added a comment - Maybe rfscholte can try to escalate this with Rory O'Donnell?

            Diamonds covers Cyrillic characters. 
             

            ❯ cd ~
            ❯ pwd
            
            Path
            ----
            C:\Users\Владимир
            

            Java Runtime and compiler work fine (at least in simple cases). So, I suppose such behaviour of mvn is unacceptable. If I can give any diagnostics, just tell me.

            P.S. I've checked "Beta: Use Unicode UTF-8 for worldwide language support" setting.

            zlumyo Vladimir Ivanov added a comment - Diamonds covers Cyrillic characters.    ❯ cd ~ ❯ pwd Path ---- C:\Users\Владимир Java Runtime and compiler work fine (at least in simple cases). So, I suppose such behaviour of mvn is unacceptable. If I can give any diagnostics, just tell me. P.S. I've checked "Beta: Use Unicode UTF-8 for worldwide language support" setting.
            rfscholte Robert Scholte added a comment -

            Should we reconsider to unpack and bundle dll s with the Maven distribution only for Windows?

            rfscholte Robert Scholte added a comment - Should we reconsider to unpack and bundle dll s with the Maven distribution only for Windows?
            michael-o Michael Osipov added a comment - - edited

            There is very little we can do because Java uses the ANSI version of Windows APIs to load DLLs. OpenJDK team needs to change that.
            The only workaround we can provide is to add the exploded directory with native libraries, but still if you put Maven into a dir with non-ASCII chars it will fail anyway.
            Alternatively, one can disable Jansi through a system property or provide a directory yourself and pass that to Maven – all workarounds.

            At the end, Windows is a terrible development OS with old cruft.

            michael-o Michael Osipov added a comment - - edited There is very little we can do because Java uses the ANSI version of Windows APIs to load DLLs. OpenJDK team needs to change that. The only workaround we can provide is to add the exploded directory with native libraries, but still if you put Maven into a dir with non-ASCII chars it will fail anyway. Alternatively, one can disable Jansi through a system property or provide a directory yourself and pass that to Maven – all workarounds. At the end, Windows is a terrible development OS with old cruft.
            michael-o Michael Osipov added a comment -

            Again my request: rfscholte, please try to reach out to Oracle and reconsider their position on the JBS issue to solve this once and for all mankind.

            michael-o Michael Osipov added a comment - Again my request: rfscholte , please try to reach out to Oracle and reconsider their position on the JBS issue to solve this once and for all mankind.
            rfscholte Robert Scholte added a comment -

            Well, https://bugs.openjdk.java.net/browse/JDK-8017274 is closed as Won't Fix. I'm afraid there's not a lot I can do about it.

            rfscholte Robert Scholte added a comment - Well, https://bugs.openjdk.java.net/browse/JDK-8017274 is closed as Won't Fix. I'm afraid there's not a lot I can do about it.
            rfscholte Robert Scholte added a comment -

            Theoratically you're right, but AFAIK nobody hit this issue while we were using the exploded directory. The Maven directory most likely doesn't contain a tricky unicode path, whereas the username (and hence the matching temp dir) does.

            rfscholte Robert Scholte added a comment - Theoratically you're right, but AFAIK nobody hit this issue while we were using the exploded directory. The Maven directory most likely doesn't contain a tricky unicode path, whereas the username (and hence the matching temp dir) does.
            michael-o Michael Osipov added a comment -

            But https://bugs.openjdk.java.net/browse/JDK-8195129 not. This one we should try to pursue.

            Well, Maven can also be installed into user's home which will fail also. Let's try to explode for Windows and zip distro only.

            michael-o Michael Osipov added a comment - But https://bugs.openjdk.java.net/browse/JDK-8195129 not. This one we should try to pursue. Well, Maven can also be installed into user's home which will fail also. Let's try to explode for Windows and zip distro only.
            michael-o Michael Osipov added a comment - - edited

            Parts of 6bed162a65bcd2f8ab481ed3c938b83814cb550d (master) and 73f34c00d16c24edb0e5f9d7eb63bc0c730a72d1 (3.8.x) need to be reverted.

            michael-o Michael Osipov added a comment - - edited Parts of 6bed162a65bcd2f8ab481ed3c938b83814cb550d (master) and 73f34c00d16c24edb0e5f9d7eb63bc0c730a72d1 (3.8.x) need to be reverted.
            michael-o Michael Osipov added a comment -

            Please see MNG-7254 and try out branch MNG-7254_maven-3.8.x. I will intentionally handle this issue because we cannot solve it. I don't want to leave the impression that we were able to.

            michael-o Michael Osipov added a comment - Please see MNG-7254 and try out branch MNG-7254 _maven-3.8.x . I will intentionally handle this issue because we cannot solve it. I don't want to leave the impression that we were able to.
            michael-o Michael Osipov added a comment -

            Alternative possible: -Djansi.tmpdir=..., but cumbersome.

            michael-o Michael Osipov added a comment - Alternative possible: -Djansi.tmpdir=... , but cumbersome.

            People

              Unassigned Unassigned
              zlumyo Vladimir Ivanov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: