Archived Forum Post

Index of archived forum posts

Question:

Best way for my Java application cross platform when use Chilkat library?

Jun 20 '14 at 12:26

Hi.

I usually develop only with windows., But today, I have to do it cross platform.

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 chilkat library on java application with cross platform ?

Please guide best way to me.

Thank you.


Answer

Your code would be the same in all cases:

...
        System.loadLibrary("chilkat");
...

The only difference is that on Linux the Java runtime would find and load libchilkat.so, whereas on Windows the runtime would find and load chilkat.dll