void (ModifiableRootModel model, final String name, final String path) { final Library.ModifiableModel modifiableModel = model.getModuleLibraryTable().createLibrary(name).getModifiableModel(); final VirtualFile home = LocalFileSystem.getInstance().refreshAndFindFileByPath(PathManager.getHomePath() + path); modifiableModel.addRoot(home, OrderRootType.CLASSES); modifiableModel.commit(); }