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.Unable to load jansi native library #297

Open
shichunyuez opened this issue Sep 6, 2024 · 0 comments
Open

Comments

@shichunyuez
Copy link

OS is windows 11

E:\Workspaces2\jansi>java -version
java version "1.8.0_66"
Java(TM) SE Runtime Environment (build 1.8.0_66-b18)
Java HotSpot(TM) 64-Bit Server VM (build 25.66-b18, mixed mode)

E:\Workspaces2\jansi>java -jar jansi-2.4.0.jar
Jansi 2.4.0

library.jansi.path=
library.jansi.version=
Failed to load native library:jansi-2.4.0-30e096d3735a1658-jansi.dll. osinfo: Windows/x86_64
java.lang.UnsatisfiedLinkError: C:\Users\scy\AppData\Local\Temp\jansi-2.4.0-30e096d3735a1658-jansi.dll: 拒绝访问(access denied)。
Failed to load native library:jansi-2.4.0-dd7c488174fb2ead-jansi.dll. osinfo: Windows/x86_64
java.lang.UnsatisfiedLinkError: C:\Users\scy\AppData\Local\Temp\jansi-2.4.0-dd7c488174fb2ead-jansi.dll: 拒绝访问(access denied)。
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;D:\programFiles\jdk\jdk1.8\bin;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;D:\programFiles\jdk\jdk1.8\bin;C:\Program Files\Common Files\Oracle\Java\javapath\abc;D:\programFiles\oracleDB\app\oracle\product\11.2.0\server\bin;D:\programFiles\VMworkStationPro17\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;D:\programFiles\git2.40.1\Git\cmd;D:\JavaData\apache-maven-3.9.6\bin;C:\Program Files\MySQL\MySQL Server 5.7\bin;D:\programFiles\xshell7;C:\Users\scy\AppData\Local\Microsoft\WindowsApps;D:\programFiles\Microsoft VS Code\bin;.]
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= GBK
java.version= 1.8.0_66, java.vendor= Oracle Corporation, java.home= D:\programFiles\jdk\jdk1.8\jre

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-e58a01f9bb2f8076-jansi.dll. osinfo: Windows/x86_64
java.lang.UnsatisfiedLinkError: C:\Users\scy\AppData\Local\Temp\jansi-2.4.0-e58a01f9bb2f8076-jansi.dll: 拒绝访问。
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: /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
                /\/\/\/\/\/\/\/\

                  ┌──┐┌─────┐ ┌─────┐ ┌──────┬──┐
                  │██├┘█████└┬┘█████└┬┘██████│?▌│
             ┌──┐ │██│██▄▄▄██│██┌─┐██│██▄▄▄▄ │▄▄│
             │??└─┘?█│?█┌─┐?█│?█│ │?█│ ?????█│?█│
             └┐▓▓▓▓▓┌┤▓▓│ │▓▓│▓▓│ │▓▓│?▓▓▓▓▓?│▓▓│
              └─────┘└──┘ └──┴──┘ └──┴───────┴──┘
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

1 participant