diff --git a/main/api/src/mill/api/ClassLoader.scala b/main/api/src/mill/api/ClassLoader.scala index 3c25f6379ba..29d32e0a9f7 100644 --- a/main/api/src/mill/api/ClassLoader.scala +++ b/main/api/src/mill/api/ClassLoader.scala @@ -2,11 +2,6 @@ package mill.api import java.net.{URL, URLClassLoader} -import java.nio.file.{FileAlreadyExistsException, FileSystemException} - -import mill.java9rtexport.Export -import scala.util.Properties - /** * Utilities for creating classloaders for running compiled Java/Scala code in * isolated classpaths. @@ -22,10 +17,7 @@ object ClassLoader { sharedPrefixes: Seq[String] = Seq(), logger: Option[mill.api.Logger] = None )(implicit ctx: Ctx.Home): URLClassLoader = { - new URLClassLoader( - makeUrls(urls).toArray, - refinePlatformParent(parent) - ) { + new URLClassLoader(urls.toArray, refinePlatformParent(parent)) { override def findClass(name: String): Class[?] = { if (sharedPrefixes.exists(name.startsWith)) { logger.foreach( @@ -73,31 +65,4 @@ object ClassLoader { appClassLoader.getParent() } } - - private def makeUrls(urls: Seq[URL])(implicit ctx: Ctx.Home): Seq[URL] = { - if (java9OrAbove) { - val java90rtJar = ctx.home / Export.rtJarName - if (!os.exists(java90rtJar)) { - // Time between retries should go from 100 ms to around 10s, which should - // leave plenty of time for another process to write fully this 50+ MB file - val retry = Retry( - count = 7, - backoffMillis = 100, - filter = { - case (_, _: FileSystemException) if Properties.isWin => true - case _ => false - } - ) - retry { - try os.copy(os.Path(Export.rt()), java90rtJar, createFolders = true) - catch { - case e: FileAlreadyExistsException => /* someone else already did this */ - } - } - } - urls :+ java90rtJar.toIO.toURI().toURL() - } else { - urls - } - } } diff --git a/runner/src/mill/runner/MillMain.scala b/runner/src/mill/runner/MillMain.scala index 7cc01375bd5..aea2cb16a54 100644 --- a/runner/src/mill/runner/MillMain.scala +++ b/runner/src/mill/runner/MillMain.scala @@ -6,7 +6,6 @@ import java.nio.file.StandardOpenOption import java.util.Locale import scala.jdk.CollectionConverters.* import scala.util.Properties -import mill.java9rtexport.Export import mill.api.{MillException, SystemStreams, WorkspaceRoot, internal} import mill.bsp.{BspContext, BspServerResult} import mill.main.BuildInfo @@ -195,16 +194,6 @@ object MillMain { val threadCount = Some(maybeThreadCount.toOption.get) - if (mill.main.client.Util.isJava9OrAbove) { - val rt = config.home / Export.rtJarName - if (!os.exists(rt)) { - streams.err.println( - s"Preparing Java ${System.getProperty("java.version")} runtime; this may take a minute or two ..." - ) - Export.rtTo(rt.toIO, false) - } - } - val bspContext = if (bspMode) Some(new BspContext(streams, bspLog, config.home)) else None