Skip to content

Commit

Permalink
Merge pull request #54 from ChristianSchulte/master
Browse files Browse the repository at this point in the history
java.lang.UnsatisfiedLinkError when native library is not found.
  • Loading branch information
chirino authored Jun 14, 2016
2 parents 03e7a2a + 823ee46 commit a54d2b5
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions jansi/src/main/java/org/fusesource/jansi/AnsiConsole.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,34 @@
public class AnsiConsole {

public static final PrintStream system_out = System.out;
public static final PrintStream out = new PrintStream(wrapOutputStream(system_out));
public static final PrintStream out;

public static final PrintStream system_err = System.err;
public static final PrintStream err = new PrintStream(wrapOutputStream(system_err, STDERR_FILENO));
public static final PrintStream err;

private static int installed;

static
{
PrintStream jansiOut;
PrintStream jansiErr;

try
{
jansiOut = new PrintStream( wrapOutputStream( system_out ) );
jansiErr = new PrintStream( wrapOutputStream( system_err, STDERR_FILENO ) );
}
catch ( final UnsatisfiedLinkError e )
{
// Failure loading native library.
jansiOut = system_out;
jansiErr = system_err;
}

out = jansiOut;
err = jansiErr;
}

private AnsiConsole() {
}

Expand Down

0 comments on commit a54d2b5

Please sign in to comment.