I usually use chilkat library (http://www.chilkatsoft.com/java.asp) develop only with windows. but this library have each library file for each platform, and today I have to do it cross platform.
Example
- Windows x64 use win64.dll
- Windows x84 use win32.dll
- Linux x64 use linux64.so
- Linux x32 use linux32.so
- Max OSX use osx.jnilib
This my source code for include chilkat library when use windows only.
static {
try {
System.loadLibrary("lib/win64");
} catch (UnsatisfiedLinkError e) {
try {
System.loadLibrary("lib/win32");
} catch (UnsatisfiedLinkError e2) {
System.err.println("Native code library failed to load.\n" + e2);
System.exit(1);
}
}
}
And now I no idea. How include each library file on java application for cross platform ?
Please guide best way to me.
Thank you.
Edit1: sorry for confusion. i know how find os.name on runtime. but this question i mean how include each library file for run each platform.