X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0e9c0448c6566825b170b98ecff716b098bda10e..0b83205608b7fc3e935b970509a08e381ad1dffe:/src/bindings/java/org/simgrid/msg/Msg.java?ds=sidebyside diff --git a/src/bindings/java/org/simgrid/msg/Msg.java b/src/bindings/java/org/simgrid/msg/Msg.java index 229566c9d5..108c7b53b7 100644 --- a/src/bindings/java/org/simgrid/msg/Msg.java +++ b/src/bindings/java/org/simgrid/msg/Msg.java @@ -1,13 +1,10 @@ -/* - * JNI interface to C code for MSG. - * - * Copyright (c) 2006-2013. The SimGrid Team. - * All right reserved. - * - * This program is free software; you can redistribute - * it and/or modify it under the terms of the license - * (GNU LGPL) which comes with this package. - */ +/* JNI interface to C code for MSG. */ + +/* Copyright (c) 2006-2014. The SimGrid Team. + * All rights reserved. */ + +/* This program is free software; you can redistribute it and/or modify it + * under the terms of the license (GNU LGPL) which comes with this package. */ package org.simgrid.msg; @@ -25,11 +22,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,19 +34,7 @@ public final class Msg { nativeInit(); } private static void loadLib (String name) { - 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 Path = NativeLib.getPath(); String filename=name; InputStream in = Msg.class.getClassLoader().getResourceAsStream(Path+filename);