Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[java] unpack dll/so to a tempDir instead of messing with their name
[simgrid.git] / src / bindings / java / org / simgrid / msg / Msg.java
index c442da4..b324db8 100644 (file)
@@ -11,28 +11,6 @@ import org.simgrid.NativeLib;
 
 
 public final class Msg {
-       /* Statically load the library which contains all native functions used in here */
-       static private boolean isNativeInited = false;
-       public static void nativeInit() {
-               if (isNativeInited)
-                       return;
-               try {
-                       NativeLib.nativeInit("winpthread");
-               } catch (Exception e)  {
-                       if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
-                               System.err.println("Cannot load winpthread.dll:");
-                               e.printStackTrace();
-                       }
-               }
-
-               NativeLib.nativeInit("simgrid");
-               NativeLib.nativeInit("simgrid-java");      
-               isNativeInited = true;
-       }
-
-       static {
-               nativeInit();
-       }
 
        /** Retrieve the simulation time
         * @return The simulation time.
@@ -131,4 +109,9 @@ public final class Msg {
                /* Execute the simulation */
                Msg.run();
        }
+       
+       /* Class initializer, to initialize various JNI stuff */
+       static {
+               org.simgrid.NativeLib.nativeInit();
+       }
 }