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 when native library is not found. #54

Merged
merged 1 commit into from
Jun 14, 2016
Merged

java.lang.UnsatisfiedLinkError when native library is not found. #54

merged 1 commit into from
Jun 14, 2016

Conversation

ChristianSchulte
Copy link
Contributor

When the native library cannot be loaded, AnsiConsole fails to initialize throwing an UnsatisfiedLinkError.

…jansi64-1.12 in java.library.path, no jansi-1.12 in java.library.path, no jansi in java.library.path]
@ChristianSchulte
Copy link
Contributor Author

Exception in thread "main" java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi64-1.12 in java.library.path, no jansi-1.12 in java.library.path, no jansi in java.library.path]
        at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:182)
        at org.fusesource.hawtjni.runtime.Library.load(Library.java:140)
        at org.fusesource.jansi.internal.CLibrary.<clinit>(CLibrary.java:42)
        at org.fusesource.jansi.AnsiConsole.wrapOutputStream(AnsiConsole.java:48)
        at org.fusesource.jansi.AnsiConsole.<clinit>(AnsiConsole.java:38)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:215)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

@hboutemy
Copy link
Collaborator

+1

@michael-o
Copy link
Contributor

michael-o commented Jun 13, 2016

This patch works here on FreeBSD without libjansi.so, though looking quite cheap.

@chirino
Copy link
Member

chirino commented Jun 14, 2016

Thanks!

@chirino chirino closed this Jun 14, 2016
@chirino chirino reopened this Jun 14, 2016
@chirino chirino merged commit a54d2b5 into fusesource:master Jun 14, 2016
@gslowikowski
Copy link

This change catches UnsatisfiedLinkError and there is no info that native libraries initialization failed.

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 this pull request may close these issues.

None yet

5 participants