Skip to content

Commit 1276bd0

Browse files
committed
cleanup
1 parent 04a8d16 commit 1276bd0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

repl-embedded/src/scala/tools/repl/EmbeddedReplMain.scala

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,13 @@ object EmbeddedReplMain {
6666
def main(args: Array[String]): Unit = {
6767
// Get the location of the current jar to use as classpath
6868
val codeSource = getClass.getProtectionDomain.getCodeSource
69-
val jarPath = System.getProperty("java.class.path")
7069

7170
// Add -classpath argument pointing to the shaded jar itself
7271
// This allows the ReplDriver's compiler to find scala.* classes
7372
val argsWithClasspath = if (args.exists(arg => arg == "-classpath" || arg == "-cp")) {
7473
args // Already has classpath
7574
} else {
76-
Array("-classpath", jarPath) ++ args
75+
Array("-classpath", System.getProperty("java.class.path")) ++ args
7776
}
7877

7978
// Create the unshading classloader with the current classloader as parent
@@ -91,8 +90,6 @@ object EmbeddedReplMain {
9190
"" // extraPredef: String
9291
)
9392

94-
// Call tryRunning on the ReplDriver
95-
val tryRunningMethod = replDriverClass.getMethod("tryRunning")
96-
tryRunningMethod.invoke(replDriver)
93+
replDriverClass.getMethod("tryRunning").invoke(replDriver)
9794
}
9895
}

0 commit comments

Comments
 (0)