private static void removeLibrary(@NotNull final Project project) {
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@Override
public void run() {
ScriptingLibraryManager libraryManager = ServiceManager.getService(project, JSLibraryManager.class);
ScriptingLibraryModel model = libraryManager.getLibraryByName(JstdLibraryUtil.LIBRARY_NAME);
assert model != null;
libraryManager.removeLibrary(model);
libraryManager.commitChanges();
}
});
}