void (String value, ModifiableRootModel model) { JavaSdkVersion version = getSdkVersion(model); if (version != null && version.isAtLeast(JavaSdkVersion.JDK_11)) { Module module = model.getModule(); int preferredVersion = version.ordinal(); ApplicationManager.getApplication().invokeLater(() -> { ExternalLibraryDescriptor libraryDescriptor = new ExternalLibraryDescriptor("org.openjfx", "javafx-fxml", "11", null, String.valueOf(preferredVersion)); JavaProjectModelModificationService.getInstance(module.getProject()) .addDependency(module, libraryDescriptor, DependencyScope.COMPILE); }, module.getDisposed()); } }