native-utils icon indicating copy to clipboard operation
native-utils copied to clipboard

Auto map Library Name for different platform

Open liux-pro opened this issue 4 years ago • 1 comments

hi What a good library the NativeUtils is! NativeUtils works pretty nice.

By using code below,I can load different native library on different platform. is that necessary to encapsulate System.mapLibraryName() into NativeUtils?

// mapLibraryName() return a platform-dependent native library name
// we get "libHelloJNI.dll" on windows
// we get "libHelloJNI.so" on linux
String libraryName = System.mapLibraryName("libHelloJNI");
NativeUtils.loadLibraryFromJar("/"+libraryName);

liux-pro avatar Nov 06 '20 05:11 liux-pro

look at mine: https://github.com/xuges/natives

xuges avatar Jan 18 '24 13:01 xuges