Sdk (@NotNull String jdkName, @NotNull String home, boolean isJre) { Path jdkHomePath = Path.of(home); if (!Files.exists(jdkHomePath)) { throw new IllegalArgumentException(jdkHomePath.toAbsolutePath() + " doesn't exist"); } ProjectJdkImpl jdk = new ProjectJdkImpl(jdkName, this); SdkModificator sdkModificator = jdk.getSdkModificator(); sdkModificator.setHomePath(FileUtil.toSystemIndependentName(home)); if (JdkVersionDetector.isVersionString(jdkName)) { sdkModificator.setVersionString(jdkName); // must be set after home path, otherwise setting home path clears the version string } addClasses(jdkHomePath, sdkModificator, isJre); addSources(jdkHomePath, sdkModificator); addDocs(jdkHomePath, sdkModificator, null); attachJdkAnnotations(sdkModificator); sdkModificator.commitChanges(); return jdk; }