[Arakhnę-Dev] [74] Bug fix: on Windows x64 JVM, System.load() seems to be not equivalent to Runtime.getRuntime().load() with additional class loader.

[ Thread Index | Date Index | More arakhne.org/dev Archives ]


Revision: 74
Author:   galland
Date:     2009-06-16 16:35:40 +0200 (Tue, 16 Jun 2009)

Log Message:
-----------
Bug fix: on Windows x64 JVM, System.load() seems to be not equivalent to Runtime.getRuntime().load() with additional class loader.

Modified Paths:
--------------
    trunk/arakhneVmutils/java/src/main/java/org/arakhne/vmutil/LibraryLoader.java


Modified: trunk/arakhneVmutils/java/src/main/java/org/arakhne/vmutil/LibraryLoader.java
===================================================================
--- trunk/arakhneVmutils/java/src/main/java/org/arakhne/vmutil/LibraryLoader.java	2009-05-20 19:37:06 UTC (rev 73)
+++ trunk/arakhneVmutils/java/src/main/java/org/arakhne/vmutil/LibraryLoader.java	2009-06-16 14:35:40 UTC (rev 74)
@@ -59,7 +59,7 @@
      * @see        java.lang.System#load(java.lang.String)
      */
     public static void load(String filename) {
-    	System.load(filename);
+    	Runtime.getRuntime().load(filename);
     }
 
     /**
@@ -83,7 +83,7 @@
      * @see        java.lang.System#loadLibrary(java.lang.String)
      */
     public static void loadLibrary(String libname) {
-    	System.loadLibrary(libname);
+    	Runtime.getRuntime().loadLibrary(libname);
     }
 
     /**
@@ -107,7 +107,7 @@
      * @see        java.lang.System#load(java.lang.String)
      */
     public static void load(File filename) {
-    	System.load(filename.getAbsolutePath());
+    	Runtime.getRuntime().load(filename.getAbsolutePath());
     }
 
     /** Replies the URL for the specified library.
@@ -161,7 +161,7 @@
     public static void load(URL filename) throws IOException {
         if (filename.getProtocol().equalsIgnoreCase("file")) { //$NON-NLS-1$
         	try {
-        		System.load(new File(filename.toURI()).getAbsolutePath());
+        		load(new File(filename.toURI()));
         	} 
         	catch (URISyntaxException e) {
         		throw new FileNotFoundException(filename.toExternalForm());
@@ -191,7 +191,7 @@
     	  outs.close();
 
     	  // Load the library from the local file
-    	  System.load(f.getAbsolutePath());
+    	  load(f);
     	  
     	  // Delete local file
     	  f.deleteOnExit();


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/