Java tutorial
//package com.java2s; public class Main { static boolean nativeLibraryLoaded = false; static Object nativeLibraryLoadLock = new Object(); static void loadNativeLibrary() { synchronized (nativeLibraryLoadLock) { if (!nativeLibraryLoaded) { try { System.loadLibrary("MDWUtil"); nativeLibraryLoaded = true; } catch (Exception e) { System.err.println("Cannot load MDWUtil shared library"); } } } } }