private static boolean tryOSGILoadLibrary () {
        try {
            Class<?> fwUtilClass = NativeUnixSocket.class.getClassLoader().loadClass("org.osgi.framework.FrameworkUtil");
            Method getBundleMethod = fwUtilClass.getMethod("getBundle", new Class[] {
                Class.class
            });

            if ( getBundleMethod.invoke(null, NativeUnixSocket.class) != null ) {
                System.loadLibrary("junixsocket");
                loaded = true;
                return true;
            }
        }
        catch ( Exception e ) {}

        return false;
    }