Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Be verbose about errors encountered
authorMartin Quinson <martin.quinson@loria.fr>
Thu, 24 Sep 2015 23:10:56 +0000 (01:10 +0200)
committerMartin Quinson <martin.quinson@loria.fr>
Thu, 24 Sep 2015 23:10:56 +0000 (01:10 +0200)
src/bindings/java/org/simgrid/NativeLib.java

index 0fdf5fc..f3102c0 100644 (file)
@@ -60,19 +60,19 @@ public final class NativeLib {
                if (in == null) {
                        filename = "lib"+name+".so";
                        in = NativeLib.class.getClassLoader().getResourceAsStream(Path+filename);
                if (in == null) {
                        filename = "lib"+name+".so";
                        in = NativeLib.class.getClassLoader().getResourceAsStream(Path+filename);
-               } 
+               }
                if (in == null) {
                        filename = name+".dll";
                        in =  NativeLib.class.getClassLoader().getResourceAsStream(Path+filename);
                if (in == null) {
                        filename = name+".dll";
                        in =  NativeLib.class.getClassLoader().getResourceAsStream(Path+filename);
-               }  
+               }
                if (in == null) {
                        filename = "lib"+name+".dll";
                        in =  NativeLib.class.getClassLoader().getResourceAsStream(Path+filename);
                if (in == null) {
                        filename = "lib"+name+".dll";
                        in =  NativeLib.class.getClassLoader().getResourceAsStream(Path+filename);
-               }  
+               }
                if (in == null) {
                        filename = "lib"+name+".dylib";
                        in =  NativeLib.class.getClassLoader().getResourceAsStream(Path+filename);
                if (in == null) {
                        filename = "lib"+name+".dylib";
                        in =  NativeLib.class.getClassLoader().getResourceAsStream(Path+filename);
-               }  
+               }
                if (in == null) {
                        throw new SimGridLibNotFoundException("Cannot find library "+name+" in path "+Path+". Sorry, but this jar does not seem to be usable on your machine.");
                }
                if (in == null) {
                        throw new SimGridLibNotFoundException("Cannot find library "+name+" in path "+Path+". Sorry, but this jar does not seem to be usable on your machine.");
                }
@@ -94,8 +94,9 @@ public final class NativeLib {
                        in.close();
                        out.close();
                        System.load(fileOut.getAbsolutePath());
                        in.close();
                        out.close();
                        System.load(fileOut.getAbsolutePath());
-
                } catch (Exception e) {
                } catch (Exception e) {
+                       System.err.println("Error while extracting the native library from the jar: ");
+                       e.printStackTrace();
                        throw new SimGridLibNotFoundException("Cannot load the bindings to the "+name+" library in path "+getPath(),   e);
                }
        }
                        throw new SimGridLibNotFoundException("Cannot load the bindings to the "+name+" library in path "+getPath(),   e);
                }
        }