WslTargetEnvironmentConfiguration (@Nullable Sdk jdk) { if (jdk == null) { return null; } VirtualFile virtualFile = jdk.getHomeDirectory(); if (virtualFile == null) { return null; } WslPath wslPath = WslPath.parseWindowsUncPath(virtualFile.getPath()); if (wslPath != null) { WslTargetEnvironmentConfiguration config = new WslTargetEnvironmentConfiguration(wslPath.getDistribution()); JavaLanguageRuntimeConfiguration javaConfig = new JavaLanguageRuntimeConfiguration(); javaConfig.setHomePath(wslPath.getLinuxPath()); String jdkVersionString = jdk.getVersionString(); if (jdkVersionString != null) { javaConfig.setJavaVersionString(jdkVersionString); } config.addLanguageRuntime(javaConfig); return config; } return null; }