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

Unable to load jansi if the temp directory has UTF-8 chars #245

Closed
centeiol opened this issue Dec 13, 2022 · 2 comments
Closed

Unable to load jansi if the temp directory has UTF-8 chars #245

centeiol opened this issue Dec 13, 2022 · 2 comments

Comments

@centeiol
Copy link

Hello,

My user ha changed and now I can't lunch jansi.

But with another user no problem, is for path with LuísCENTEIO ?
Whow can I overcome this issue?

Below the two output from two users in same computer : ( hotline and LuísCENTEIO )
hotline the good

C:\Users\LuísCENTEIO>java -jar C:\Apps\sqlcl\lib\jansi.jar
Jansi 2.4.0

library.jansi.path=
library.jansi.version=
Failed to load native library:jansi-2.4.0-a29997176d7b74cc-jansi.dll. osinfo: Windows/x86_64
java.lang.UnsatisfiedLinkError: C:\Users\LuísCENTEIO\AppData\Local\Temp\jansi-2.4.0-a29997176d7b74cc-jansi.dll: Can't find dependent libraries
Failed to load native library:jansi-2.4.0-da01663cb1674f6b-jansi.dll. osinfo: Windows/x86_64
java.lang.UnsatisfiedLinkError: C:\Users\LuísCENTEIO\AppData\Local\Temp\jansi-2.4.0-da01663cb1674f6b-jansi.dll: Can't find dependent libraries
java.lang.RuntimeException: Unable to load jansi native library. You may want set the jansi.graceful system property to true to be able to use Jansi on your platform
at org.fusesource.jansi.internal.JansiLoader.initialize(JansiLoader.java:65)
at org.fusesource.jansi.AnsiMain.main(AnsiMain.java:70)
Caused by: java.lang.Exception: No native library found for os.name=Windows, os.arch=x86_64, paths=[/org/fusesource/jansi/internal/native/Windows/x86_64;C:\Program Files\Java\jdk-17.0.5\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\Common Files\Oracle\Java\javapath;C:\app\oracle\product\21.0.0\product\21.0.0\client_1\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\Microsoft VS Code\bin;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\WINDOWS\System32\OpenSSH;C:\ProgramData\chocolatey\bin;C:\tools\lxrunoffline;C:\Program Files\dotnet;c:\utils;C:\Program Files\Citrix\Citrix Files;C:\Program Files\Java\jdk1.8.0_211\bin;C:\Users\LuísCENTEIO\AppData\Local\Microsoft\WindowsApps;.]
at org.fusesource.jansi.internal.JansiLoader.loadJansiNativeLibrary(JansiLoader.java:334)
at org.fusesource.jansi.internal.JansiLoader.initialize(JansiLoader.java:62)
... 1 more

os.name= Windows 10, os.version= 10.0, os.arch= amd64
file.encoding= Cp1252
java.version= 17.0.5, java.vendor= Oracle Corporation, java.home= C:\Program Files\Java\jdk-17.0.5

jansi.graceful=
jansi.mode=
jansi.out.mode=
jansi.err.mode=
jansi.colors=
jansi.out.colors=
jansi.err.colors=
jansi.passthrough= false
jansi.strip= false
jansi.force= false
jansi.noreset= false
org.fusesource.jansi.Ansi.disable= false

IS_WINDOWS: true
IS_CONEMU: false
IS_CYGWIN: false
IS_MSYSTEM: false

Failed to load native library:jansi-2.4.0-d8d3e45b9f756f14-jansi.dll. osinfo: Windows/x86_64
java.lang.UnsatisfiedLinkError: C:\Users\LuísCENTEIO\AppData\Local\Temp\jansi-2.4.0-d8d3e45b9f756f14-jansi.dll: Can't find dependent libraries
isatty(STDOUT_FILENO): 0, System.out is NOT a terminal
isatty(STDERR_FILENO): 0, System.err is NOT a terminal

Resulting Jansi modes for stout/stderr streams:

  • System.out: AnsiPrintStream{type=Unsupported, colors=Colors16, mode=Strip, resetAtUninstall=false}
  • System.err: AnsiPrintStream{type=Unsupported, colors=Colors16, mode=Strip, resetAtUninstall=false}
    Processor types description:
  • Native: Supports ansi sequences natively
  • Unsupported: Ansi sequences are stripped out
  • VirtualTerminal: Supported through windows virtual terminal
  • Emulation: Emulated through using windows API console commands
  • Redirected: The stream is redirected to a file or a pipe
    Colors support description:
  • Colors16: 16 colors
  • Colors256: 256 colors
  • TrueColor: 24-bit colors
    Modes description:
  • Strip: Strip all ansi sequences
  • Default: Print ansi sequences if the stream is a terminal
  • Force: Always print ansi sequences, even if the stream is redirected

test on System.out: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
bright: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
bold: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
faint: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
bold+faint: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
256 colors:

     truecolor: /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\

test on System.err: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
bright: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
bold: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
faint: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
bold+faint: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
256 colors:

     truecolor: /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\

                  ┌──┐┌─────┐ ┌─────┐ ┌──────┬──┐
                  │██├┘█████└┬┘█████└┬┘██████│▐▌│
             ┌──┐ │██│██▄▄▄██│██┌─┐██│██▄▄▄▄ │▄▄│
             │▒▒└─┘▒█│▒█┌─┐▒█│▒█│ │▒█│ ▀▀▀▀▒█│▒█│
             └┐▓▓▓▓▓┌┤▓▓│ │▓▓│▓▓│ │▓▓│▀▓▓▓▓▓▀│▓▓│
              └─────┘└──┘ └──┴──┘ └──┴───────┴──┘

c:>java -jar C:\Apps\sqlcl\lib\jansi.jar
Jansi 2.4.0

library.jansi.path=
library.jansi.version=
Jansi native library loaded from C:\Users\hotline\AppData\Local\Temp\jansi-2.4.0-57cb32c49e8d6081-jansi.dll
which was auto-extracted from jar:file:/C:/Apps/sqlcl/lib/jansi.jar!/org/fusesource/jansi/internal/native/Windows/x86_64/jansi.dll

os.name= Windows 10, os.version= 10.0, os.arch= amd64
file.encoding= Cp1252
java.version= 17.0.5, java.vendor= Oracle Corporation, java.home= C:\Program Files\Java\jdk-17.0.5

jansi.graceful=
jansi.mode=
jansi.out.mode=
jansi.err.mode=
jansi.colors=
jansi.out.colors=
jansi.err.colors=
jansi.passthrough= false
jansi.strip= false
jansi.force= false
jansi.noreset= false
org.fusesource.jansi.Ansi.disable= false

IS_WINDOWS: true
IS_CONEMU: false
IS_CYGWIN: false
IS_MSYSTEM: false

isatty(STDOUT_FILENO): 1, System.out is a terminal
isatty(STDERR_FILENO): 1, System.err is a terminal

Resulting Jansi modes for stout/stderr streams:

  • System.out: AnsiPrintStream{type=VirtualTerminal, colors=Colors16, mode=Default, resetAtUninstall=true}
  • System.err: AnsiPrintStream{type=VirtualTerminal, colors=Colors16, mode=Default, resetAtUninstall=true}
    Processor types description:
  • Native: Supports ansi sequences natively
  • Unsupported: Ansi sequences are stripped out
  • VirtualTerminal: Supported through windows virtual terminal
  • Emulation: Emulated through using windows API console commands
  • Redirected: The stream is redirected to a file or a pipe
    Colors support description:
  • Colors16: 16 colors
  • Colors256: 256 colors
  • TrueColor: 24-bit colors
    Modes description:
  • Strip: Strip all ansi sequences
  • Default: Print ansi sequences if the stream is a terminal
  • Force: Always print ansi sequences, even if the stream is redirected

test on System.out: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
bright: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
bold: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
faint: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
bold+faint: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
256 colors:

     truecolor: /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\

test on System.err: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
bright: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
bold: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
faint: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
bold+faint: BLACK RED GREEN YELLOW BLUE MAGENTA CYAN WHITE DEFAULT
256 colors:

     truecolor: /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\

                  ┌──┐┌─────┐ ┌─────┐ ┌──────┬──┐
                  │██├┘█████└┬┘█████└┬┘██████│▐▌│
             ┌──┐ │██│██▄▄▄██│██┌─┐██│██▄▄▄▄ │▄▄│
             │▒▒└─┘▒█│▒█┌─┐▒█│▒█│ │▒█│ ▀▀▀▀▒█│▒█│
             └┐▓▓▓▓▓┌┤▓▓│ │▓▓│▓▓│ │▓▓│▀▓▓▓▓▓▀│▓▓│
              └─────┘└──┘ └──┴──┘ └──┴───────┴──┘
@centeiol
Copy link
Author

Done

set tmp=c:\tmp
set temp=c:\tmp

and OK

Sorry

@michael-o
Copy link
Contributor

This cannot be solved, read my explanation here: https://issues.apache.org/jira/browse/MNG-7245

@gnodet gnodet changed the title - Not able to load Jansi Unable to load jansi if the temp directory has UTF-8 chars Aug 22, 2023
@gnodet gnodet closed this as not planned Won't fix, can't repro, duplicate, stale Sep 27, 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