Skip to content

Commit efbd9d5

Browse files
committed
Limit use of java file manager to JDK 9
1 parent cd36647 commit efbd9d5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/compiler/scala/tools/util/PathResolver.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,10 @@ class PathResolver(settings: Settings, context: JavaContext) {
222222

223223
private def javaBootClasspath = {
224224
val cp = classesInPath(javaBootClassPath)
225-
val okay = cp.exists(_.findClass("java/lang/Object.class").isDefined)
226-
if (!okay) cp :+ new DirectoryClassPath(new JavaToolsPlatformArchive(), context) else cp
225+
if (scala.util.Properties.isJavaAtLeast("9") && !cp.exists(_.findClass("java/lang/Object.class").isDefined))
226+
cp :+ new DirectoryClassPath(new JavaToolsPlatformArchive(), context)
227+
else
228+
cp
227229
}
228230

229231
// Assemble the elements!

0 commit comments

Comments
 (0)