void (@NotNull Project project, @NotNull Sdk jdk, @NotNull ParametersList vm) { var sdkVersion = ((JavaSdk)jdk.getSdkType()).getVersion(jdk); if (sdkVersion != null && sdkVersion.isAtLeast(JavaSdkVersion.JDK_17)) { var scope = ProjectScope.getContentScope(project); var files = ReadAction.compute(() -> FilenameIndex.getVirtualFilesByName("OpenedPackages.txt", scope)); if (files.size() > 1) { LOG.error("expecting 1 file, found: " + files); } else if (!files.isEmpty()) { var file = files.iterator().next(); try (var stream = file.getInputStream()) { JavaModuleOptions.readOptions(stream, OS.CURRENT).forEach(vm::add); } catch (ProcessCanceledException e) { throw e; //unreachable } catch (Throwable e) { LOG.error("Failed to load --add-opens list from 'OpenedPackages.txt'", e); } } } }