diff --git a/internal/zinc-core/src/main/scala/sbt/internal/inc/MappedVirtualFile.scala b/internal/zinc-core/src/main/scala/sbt/internal/inc/MappedVirtualFile.scala index 4037971ab1..c124b46685 100644 --- a/internal/zinc-core/src/main/scala/sbt/internal/inc/MappedVirtualFile.scala +++ b/internal/zinc-core/src/main/scala/sbt/internal/inc/MappedVirtualFile.scala @@ -58,12 +58,15 @@ class MappedFileConverter(rootPaths: Map[String, Path], allowMachinePath: Boolea case Some((key, rootPath)) => MappedVirtualFile(s"$${$key}/${rootPath.relativize(path)}".replace('\\', '/'), rootPaths) case _ => - path match { - case p if p.toUri.getScheme == "jrt" => DummyVirtualFile("rt.jar", p) - case p if p.getFileName.toString == "rt.jar" => DummyVirtualFile("rt.jar", p) - case p if allowMachinePath => MappedVirtualFile(s"$p".replace('\\', '/'), rootPaths) - case p => sys.error(s"$p cannot be mapped using the root paths $rootPaths") - } + def isCtSym = + path.getFileSystem + .provider() + .getScheme == "jar" && path.getFileSystem.toString.endsWith("ct.sym") + def isJrt = path.getFileSystem.provider().getScheme == "jrt" + if (isJrt || path.getFileName.toString == "rt.jar" || isCtSym) + DummyVirtualFile("rt.jar", path) + else if (allowMachinePath) MappedVirtualFile(s"$path".replace('\\', '/'), rootPaths) + else sys.error(s"$path cannot be mapped using the root paths $rootPaths") } } }