Skip to content

Commit

Permalink
Don't throw exception when Soar lib isn't found
Browse files Browse the repository at this point in the history
Instead print a warning and let the user load the Soar native library themselves
using System.load(<path>).

Fixes #491.
  • Loading branch information
garfieldnate committed Oct 31, 2024
1 parent 34f17f1 commit 7dbce33
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Core/ClientSMLSWIG/Java/Java_sml_ClientInterface.i
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
try {
System.loadLibrary("Java_sml_ClientInterface");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load. \n" + e);
throw e ;
// IMPORTANT: do *not* re-throw e! This will cause the JVM to exit without giving the client a chance to load the library with System.load().
System.err.println("WARNING: Could not load native Java/Soar bindings from your library path.\nClient will need to load them from a specific path using System.load(<path>).\nFailing to do this will lead to additional java.lang.UnsatisfiedLinkErrors below. Original error:\n" + e);
}
}

Expand Down

0 comments on commit 7dbce33

Please sign in to comment.