Skip to content

Jansi fails to start on Mac arm #207

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

Closed
michaelabuckley opened this issue Apr 21, 2021 · 4 comments · May be fixed by gnodet/jansi#1
Closed

Jansi fails to start on Mac arm #207

michaelabuckley opened this issue Apr 21, 2021 · 4 comments · May be fixed by gnodet/jansi#1

Comments

@michaelabuckley
Copy link

michaelabuckley commented Apr 21, 2021

No native code included for arm.
macOS 11.2.3 Apple M1
Jansi 2.3.2

Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.fusesource.jansi.AnsiConsole.ansiStream(AnsiConsole.java:239)
	at org.fusesource.jansi.AnsiConsole.initStreams(AnsiConsole.java:542)
	at org.fusesource.jansi.AnsiConsole.systemInstall(AnsiConsole.java:496)
	at ca.cdr.app.control.ControlClient.<init>(ControlClient.java:54)
	at ca.cdr.app.App.main(App.java:201)
Caused by: java.lang.RuntimeException: Unable to load jansi native library
	at org.fusesource.jansi.internal.JansiLoader.initialize(JansiLoader.java:62)
	at org.fusesource.jansi.internal.CLibrary.<clinit>(CLibrary.java:30)
	... 5 more
Caused by: java.lang.Exception: No native library found for os.name=Mac, os.arch=aarch64, paths=[/Users/michael/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
	at org.fusesource.jansi.internal.JansiLoader.loadJansiNativeLibrary(JansiLoader.java:333)
	at org.fusesource.jansi.internal.JansiLoader.initialize(JansiLoader.java:60)
	... 6 more

Output of uname -a

Darwin mb-m1 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 arm64
@rfscholte
Copy link

This issue is blocking https://issues.apache.org/jira/browse/MNG-7165 (and considered a regression).
Looking at the comment of the try/catch block of https://github.com/fusesource/jansi/blob/jansi-2.3.2/src/main/java/org/fusesource/jansi/AnsiConsole.java#L239-L250 the fd initialization should be done inside the try-block.

@michaelabuckley
Copy link
Author

@rfscholte - I just did the dumb thing

try {
    AnsiConsole.systemInstall();
} catch (Error e) {
   // log some stuff
}

@rfscholte
Copy link

I don't think that will work in our case, The library maven-shared-utils is used by both Maven and maven-plugins, they can all have their own version. JAnsi is bundled with Maven, so we could fix it for Maven, but not for the plugins.

rfscholte added a commit to rfscholte/jansi that referenced this issue Jun 2, 2021
gnodet added a commit to gnodet/jansi that referenced this issue Jun 11, 2021
@gnodet gnodet closed this as completed in e4d58d9 Jun 11, 2021
@michaelabuckley
Copy link
Author

FYI - https://github.com/java-native-access/jna supports Mac ARM now. That might be easier that shipping your own dlls.

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

Successfully merging a pull request may close this issue.

2 participants