JpsTypedLibrary<JpsSdk<JpsDummyElement>> (@NotNull JpsGlobal global, @NotNull String name, @NotNull String homePath) { JdkVersionDetector.JdkVersionInfo jdkInfo = JdkVersionDetector.getInstance().detectJdkVersionInfo(homePath); assert jdkInfo != null : homePath; String version = JdkVersionDetector.formatVersionString(jdkInfo.version); JpsTypedLibrary<JpsSdk<JpsDummyElement>> sdk = global.addSdk(name, homePath, version, JpsJavaSdkType.INSTANCE); List<Path> roots = JavaSdkUtil.getJdkClassesRoots(Paths.get(homePath), false); for (Path root : roots) { sdk.addRoot(root.toFile(), JpsOrderRootType.COMPILED); } return sdk; }