void (Library library, LibraryTable libraryTable) { ModifiableRootModel rootModel = ModuleRootManager.getInstance(getModule()).getModifiableModel(); LibraryOrderEntry libraryOrderEntry = OrderEntryUtil.findLibraryOrderEntry(rootModel, library); rootModel.removeOrderEntry(libraryOrderEntry); rootModel.commit(); LibraryTable.ModifiableModel libraryTableModifiableModel = libraryTable.getModifiableModel(); libraryTableModifiableModel.removeLibrary(library); libraryTableModifiableModel.commit(); }