Skip to content

Commit

Permalink
Issue #422: Recover from link error when jna is unavailable
Browse files Browse the repository at this point in the history
  • Loading branch information
mabe02 committed Jun 14, 2020
1 parent 60d8d41 commit 0f89334
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,11 @@ private Terminal createWindowsTerminal() throws IOException {
Constructor<?> constructor = nativeImplementation.getConstructor(InputStream.class, OutputStream.class, Charset.class, UnixLikeTTYTerminal.CtrlCBehaviour.class);
return (Terminal)constructor.newInstance(inputStream, outputStream, charset, UnixLikeTTYTerminal.CtrlCBehaviour.CTRL_C_KILLS_APPLICATION);
}
catch(Exception ignore) {
catch(Exception | NoClassDefFoundError ignore) {
try {
return createCygwinTerminal(outputStream, inputStream, charset);
} catch(IOException e) {
throw new IOException("To start java on Windows, use javaw! (see https://github.com/mabe02/lanterna/issues/335 )", e);
throw new IOException("To use Lanterna on Windows, either add JNA (and jna-platform) to the classpath or use javaw! (see https://github.com/mabe02/lanterna/issues/335)", e);
}
}
}
Expand Down

0 comments on commit 0f89334

Please sign in to comment.