Skip to content

Commit c9c9e27

Browse files
authored
Merge pull request #10697 from hppritcha/java_better_loadlibrary
java: catch exceptions if we fail to load mpi_java
2 parents ba24786 + 54042fc commit c9c9e27

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

ompi/mpi/java/java/MPI.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,15 @@ public final class MPI
204204

205205
static
206206
{
207-
System.loadLibrary("mpi_java");
207+
try
208+
{
209+
System.loadLibrary("mpi_java") ;
210+
}
211+
catch (UnsatisfiedLinkError e)
212+
{
213+
System.err.println("mpi java lib failed to load: " + e + "\n") ;
214+
System.exit(1) ;
215+
}
208216

209217
DATATYPE_NULL = new Datatype();
210218

0 commit comments

Comments
 (0)