Fixed patchset branches
This commit is contained in:
@@ -37,10 +37,9 @@ class CoreJrtFileSystem : DeprecatedVirtualFileSystem() {
|
|||||||
val rootUri = URI.create(StandardFileSystems.JRT_PROTOCOL + ":/")
|
val rootUri = URI.create(StandardFileSystems.JRT_PROTOCOL + ":/")
|
||||||
val jrtFsJar = loadJrtFsJar(jdkHome) ?: return@createMap null
|
val jrtFsJar = loadJrtFsJar(jdkHome) ?: return@createMap null
|
||||||
val fileSystem =
|
val fileSystem =
|
||||||
if (SystemInfo.isJavaVersionAtLeast(9, 0, 0)) {
|
if (isAtLeastJava9()) {
|
||||||
FileSystems.newFileSystem(rootUri, mapOf("java.home" to jdkHome.absolutePath))
|
FileSystems.newFileSystem(rootUri, mapOf("java.home" to jdkHome.absolutePath))
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
val classLoader = URLClassLoader(arrayOf(jrtFsJar.toURI().toURL()), null)
|
val classLoader = URLClassLoader(arrayOf(jrtFsJar.toURI().toURL()), null)
|
||||||
FileSystems.newFileSystem(rootUri, emptyMap<String, Nothing>(), classLoader)
|
FileSystems.newFileSystem(rootUri, emptyMap<String, Nothing>(), classLoader)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
|
* that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.cli.jvm.modules
|
||||||
|
|
||||||
|
import com.intellij.openapi.util.SystemInfo
|
||||||
|
|
||||||
|
fun isAtLeastJava9(): Boolean {
|
||||||
|
return SystemInfo.isJavaVersionAtLeast(9, 0, 0)
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
|
* that can be found in the license/LICENSE.txt file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.kotlin.cli.jvm.modules
|
||||||
|
|
||||||
|
import com.intellij.openapi.util.SystemInfo
|
||||||
|
|
||||||
|
fun isAtLeastJava9(): Boolean {
|
||||||
|
return SystemInfo.isJavaVersionAtLeast("9")
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user