@@ -38,16 +38,21 @@ public class NativeLibraryLoader {
3838 // For Android, os.name is also "Linux", so we need an extra check
3939 boolean android = System .getProperty ("java.vendor" ).contains ("Android" );
4040 if (!android ) {
41- String osName = System .getProperty ("os.name" );
41+ String osName = System .getProperty ("os.name" ). toLowerCase () ;
4242 String sunArch = System .getProperty ("sun.arch.data.model" );
43- if (osName .contains ("Windows" )) {
44- libname += "-windows" + ("32" .equals (sunArch ) ? "-x86" : "-x64" );
43+ String cpuArchPostfix = "32" .equals (sunArch ) ? "-x86" : "-x64" ;
44+ if (osName .contains ("windows" )) {
45+ libname += "-windows" + cpuArchPostfix ;
4546 filename = libname + ".dll" ;
4647 checkUnpackLib (filename );
47- } else if (osName .contains ("Linux " )) {
48- libname += "-linux" + ( "32" . equals ( sunArch ) ? "-x86" : "-x64" ) ;
48+ } else if (osName .contains ("linux " )) {
49+ libname += "-linux" + cpuArchPostfix ;
4950 filename = "lib" + libname + ".so" ;
5051 checkUnpackLib (filename );
52+ } else if (osName .contains ("mac" )) {
53+ libname += "-macos" + cpuArchPostfix ;
54+ filename = "lib" + libname + ".dylib" ;
55+ checkUnpackLib (filename );
5156 }
5257 }
5358 File file = new File (filename );
0 commit comments