Skip to content

Commit 8c90ae6

Browse files
committed
Resolve classes found in the jrt:/ filesystem
The standard Java library as well as any other module used will not be available in the regular Java classpath but only in the jrt:/ filesystem.
1 parent b56420a commit 8c90ae6

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

compiler/src/dotty/tools/dotc/config/PathResolver.scala

+9-8
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ package config
55
import java.net.{ URL, MalformedURLException }
66
import WrappedProperties.AccessControl
77
import io.{ ClassPath, File, Directory, Path, AbstractFile }
8-
import classpath.{AggregateClassPath, ClassPathFactory }
8+
import classpath.{AggregateClassPath, ClassPathFactory, JrtClassPath }
99
import ClassPath.{ JavaContext, join, split }
1010
import PartialFunction.condOpt
1111
import scala.language.postfixOps
@@ -225,13 +225,14 @@ class PathResolver(implicit ctx: Context) {
225225
// priority class path takes precedence
226226
def basis = List[Traversable[ClassPath]](
227227
classesInExpandedPath(priorityClassPath), // 0. The priority class path (for testing).
228-
classesInPath(javaBootClassPath), // 1. The Java bootstrap class path.
229-
contentsOfDirsInPath(javaExtDirs), // 2. The Java extension class path.
230-
classesInExpandedPath(javaUserClassPath), // 3. The Java application class path.
231-
classesInPath(scalaBootClassPath), // 4. The Scala boot class path.
232-
contentsOfDirsInPath(scalaExtDirs), // 5. The Scala extension class path.
233-
classesInExpandedPath(userClassPath), // 6. The Scala application class path.
234-
sourcesInPath(sourcePath) // 7. The Scala source path.
228+
JrtClassPath.apply(), // 1. The Java 9 classpath (backed by the jrt:/ virtual system, if available)
229+
classesInPath(javaBootClassPath), // 2. The Java bootstrap class path.
230+
contentsOfDirsInPath(javaExtDirs), // 3. The Java extension class path.
231+
classesInExpandedPath(javaUserClassPath), // 4. The Java application class path.
232+
classesInPath(scalaBootClassPath), // 5. The Scala boot class path.
233+
contentsOfDirsInPath(scalaExtDirs), // 6. The Scala extension class path.
234+
classesInExpandedPath(userClassPath), // 7. The Scala application class path.
235+
sourcesInPath(sourcePath) // 8. The Scala source path.
235236
)
236237

237238
lazy val containers = basis.flatten.distinct

0 commit comments

Comments
 (0)