diff --git a/repl/scala-2.11/src/main/scala/org/apache/livy/repl/SparkInterpreter.scala b/repl/scala-2.11/src/main/scala/org/apache/livy/repl/SparkInterpreter.scala index 98c478f35..05b076697 100644 --- a/repl/scala-2.11/src/main/scala/org/apache/livy/repl/SparkInterpreter.scala +++ b/repl/scala-2.11/src/main/scala/org/apache/livy/repl/SparkInterpreter.scala @@ -74,8 +74,11 @@ class SparkInterpreter(protected override val conf: SparkConf) extends AbstractS Paths.get(u.toURI).getFileName.toString.contains("org.scala-lang_scala-reflect") } - extraJarPath.foreach { p => debug(s"Adding $p to Scala interpreter's class path...") } - sparkILoop.addUrlsToClassPath(extraJarPath: _*) + extraJarPath.foreach { p => + debug(s"Adding $p to Scala interpreter's class path...") + sparkILoop.require(new File(p.toURI).getPath) + } + classLoader = null } else { classLoader = classLoader.getParent diff --git a/repl/scala-2.12/src/main/scala/org/apache/livy/repl/SparkInterpreter.scala b/repl/scala-2.12/src/main/scala/org/apache/livy/repl/SparkInterpreter.scala index bb8f7e594..abaff845c 100644 --- a/repl/scala-2.12/src/main/scala/org/apache/livy/repl/SparkInterpreter.scala +++ b/repl/scala-2.12/src/main/scala/org/apache/livy/repl/SparkInterpreter.scala @@ -74,8 +74,10 @@ class SparkInterpreter(protected override val conf: SparkConf) extends AbstractS Paths.get(u.toURI).getFileName.toString.contains("org.scala-lang_scala-reflect") } - extraJarPath.foreach { p => debug(s"Adding $p to Scala interpreter's class path...") } - sparkILoop.addUrlsToClassPath(extraJarPath: _*) + extraJarPath.foreach { p => + debug(s"Adding $p to Scala interpreter's class path...") + sparkILoop.require(new File(p.toURI).getPath) + } classLoader = null } else { classLoader = classLoader.getParent