X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/2e9105988280d1e88b5b496d6e2eed4c8d541883..281f8c29e177852dcb1591fc31e363e1176857c8:/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 e6938fbf27..93409c5cf8 100644 --- a/src/bindings/java/org/simgrid/msg/Msg.java +++ b/src/bindings/java/org/simgrid/msg/Msg.java @@ -1,7 +1,7 @@ /* * JNI interface to C code for MSG. * - * Copyright 2006-2012 The SimGrid Team. + * Copyright (c) 2006-2013. The SimGrid Team. * All right reserved. * * This program is free software; you can redistribute @@ -25,11 +25,11 @@ public final class Msg { return; try { /* prefer the version on disk, if existing */ - System.loadLibrary("SG_java"); + System.loadLibrary("simgrid-java"); } catch (UnsatisfiedLinkError e) { /* If not found, unpack the one bundled into the jar file and use it */ loadLib("simgrid"); - loadLib("SG_java"); + loadLib("simgrid-java"); } isNativeInited = true; } @@ -37,7 +37,20 @@ public final class Msg { nativeInit(); } private static void loadLib (String name) { - String Path = "NATIVE/"+System.getProperty("os.name")+"/"+System.getProperty("os.arch")+"/"; + String Os = System.getProperty("os.name"); + String Arch = System.getProperty("os.arch"); + // Some OS/Arch may be different between Java and Cmake, + // which generated the path + if (Os.toLowerCase().startsWith("win")) + Os = "Windows"; + else if (Os.contains("OS X")) + Os = "Darwin"; + if (Arch.equalsIgnoreCase("x86")) + Arch = "i386"; + else if (Arch.equalsIgnoreCase("x86_64")) + Arch = "amd64"; + String Path = "NATIVE/" + Os + "/" + Arch + "/"; + String filename=name; InputStream in = Msg.class.getClassLoader().getResourceAsStream(Path+filename); @@ -179,6 +192,8 @@ public final class Msg { */ public final static native void createEnvironment(String platformFile); + public final static native As environmentGetRoutingRoot(); + /** * The method to deploy the simulation. *