Skip to content

Commit

Permalink
jansi/#162 fix issue where bitModel could not be retrieved on GraalVM
Browse files Browse the repository at this point in the history
Non-standard system properties `sun.arch.data.model` and `com.ibm.vm.bitmode` are not available in Substrate VM (GraalVM native images). Without this fix, the `extractAndLoad` method never succeeds, even if the native library is available as a resource in the GraalVM native image.
  • Loading branch information
remkop committed Oct 23, 2019
1 parent b47586a commit 2c64ed4
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,11 @@ public static int getBitModel() {
if( prop!=null ) {
return Integer.parseInt(prop);
}
// GraalVM support, see https://github.com/fusesource/jansi/issues/162
String arch = System.getProperty("os.arch");
if (arch.endsWith("64") && "Substrate VM".equals(System.getProperty("java.vm.name"))) {
return 64;
}
return -1; // we don't know..
}

Expand Down

0 comments on commit 2c64ed4

Please sign in to comment.