private boolean deleteNativeLibrary() {
            if (file == null) {
                return true;
            }

            if (file.delete()) {
                return true;
            }

            // Reach into the bowels of ClassLoader to force the native
            // library to unload
            try {
                ClassLoader cl = Native.class.getClassLoader();
                Field f = ClassLoader.class.getDeclaredField("nativeLibraries");
                f.setAccessible(true);
                List libs = (List) f.get(cl);
                for (Iterator i = libs.iterator(); i.hasNext(); ) {
                    Object lib = i.next();
                    f = lib.getClass().getDeclaredField("name");
                    f.setAccessible(true);
                    String name = (String) f.get(lib);
                    String path = file.getAbsolutePath();
                    if (name.equals(path) || (name.indexOf(path) != -1)) {
                        Method m = lib.getClass().getDeclaredMethod("finalize", new Class[0]);
                        m.setAccessible(true);
                        m.invoke(lib, new Object[0]);

                        if (file.exists()) {
                            if (file.delete()) {
                                return true;
                            }

                            return false;
                        }


                        return true;
                    }
                }
            }
            catch (Exception e) {}

            return false;
        }