Skip to content

Commit

Permalink
util: change the expected system name from .dylib to .jnilib when .dy…
Browse files Browse the repository at this point in the history
…lib is seen

This seems to be the new default library extension under Java 7 on macs, note code was not tested at commit as I don't have a mac
  • Loading branch information
pwdraper committed Nov 5, 2013
1 parent 0244221 commit a1c0444
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions util/src/main/uk/ac/starlink/util/Loader.java
Expand Up @@ -135,6 +135,14 @@ public static void loadLibrary( String libname )
/* Get the name of the library file. */
String filename = System.mapLibraryName( libname );


/* Apparently Java 7 on OS X used .dylib, whereas we use jnilib, let's
* work around that until all Java's are 7. */
if ( libname.endsWith( "dylib" ) ) {
libname = libname.replace( ".dylib", ".jnilib" );
logger.warning( "Replaced .dylib with .jnilib to fix Java 7" );
}

/* Try to load it. */
File libfile = new File( archdir, filename );
try {
Expand Down

0 comments on commit a1c0444

Please sign in to comment.