diff options
author | Kyle Maxwell <kmaxwell@twitter.com> | 2011-02-23 10:18:11 -0800 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-11-07 02:08:37 -0500 |
commit | 705f9e24481693297e98db79adbb9aa8cd1c5a96 (patch) | |
tree | 55450c06433ad9b1bac31e2d0dca30225c72d44b /libraries/eval/Eval.scala | |
parent | e0883058a6149e3e968dfe024600108aee64e1b4 (diff) | |
download | cbt-705f9e24481693297e98db79adbb9aa8cd1c5a96.tar.gz cbt-705f9e24481693297e98db79adbb9aa8cd1c5a96.tar.bz2 cbt-705f9e24481693297e98db79adbb9aa8cd1c5a96.zip |
fix the classpath not found bug
Diffstat (limited to 'libraries/eval/Eval.scala')
-rw-r--r-- | libraries/eval/Eval.scala | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libraries/eval/Eval.scala b/libraries/eval/Eval.scala index f145fed..4bd7ac2 100644 --- a/libraries/eval/Eval.scala +++ b/libraries/eval/Eval.scala @@ -85,12 +85,14 @@ object Eval { /* * For a given FQ classname, trick the resource finder into telling us the containing jar. */ - private def jarPathOfClass(className: String) = { + private def jarPathOfClass(className: String) = try { val resource = className.split('.').mkString("/", "/", ".class") val path = getClass.getResource(resource).getPath val indexOfFile = path.indexOf("file:") + 5 val indexOfSeparator = path.lastIndexOf('!') - path.substring(indexOfFile, indexOfSeparator) + List(path.substring(indexOfFile, indexOfSeparator)) + } catch { + case e: NullPointerException => List.empty[String] // Couldn't find the resource. } /* @@ -130,7 +132,7 @@ object Eval { settings.unchecked.value = true // enable detailed unchecked warnings settings.outputDirs.setSingleOutput(virtualDirectory) - val pathList = List(compilerPath, libPath) + val pathList = compilerPath ::: libPath settings.bootclasspath.value = pathList.mkString(File.pathSeparator) settings.classpath.value = (pathList ::: impliedClassPath).mkString(File.pathSeparator) |