X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/9932a0c0d2c44e34633c97a827b2b04d615cb4e9..483e903a02a5c78a73597aabc0fc4eb517f84558:/src/bindings/java/org/simgrid/msg/Msg.java diff --git a/src/bindings/java/org/simgrid/msg/Msg.java b/src/bindings/java/org/simgrid/msg/Msg.java index 8153a4241d..263a22fa3d 100644 --- a/src/bindings/java/org/simgrid/msg/Msg.java +++ b/src/bindings/java/org/simgrid/msg/Msg.java @@ -11,19 +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; - NativeLib.nativeInit("simgrid"); - NativeLib.nativeInit("simgrid-java"); - isNativeInited = true; - } - - static { - nativeInit(); - } /** Retrieve the simulation time * @return The simulation time. @@ -70,6 +57,9 @@ public final class Msg { * @param args The arguments of the command line of the simulation. */ public final static native void init(String[]args); + + /** Tell the kernel that you want to use the energy plugin */ + public final static native void energyInit(); /** * Run the MSG simulation. @@ -122,4 +112,9 @@ public final class Msg { /* Execute the simulation */ Msg.run(); } + + /* Class initializer, to initialize various JNI stuff */ + static { + org.simgrid.NativeLib.nativeInit(); + } }