Reputation: 3
I have the code:
val a = Seq("java","-jar \""+base.getCanonicalPath+"/sbt/sbt/bin/sbt-launch.jar\"")
val proc = Process(a)
proc.!<(
new ProcessLogger {override def buffer[T](f: => T): T = f
override def out(s: => String): Unit = println(s)
override def err(s: => String): Unit = println(s)
})
}
But when i try to run it, it outputs:
Error: Unable to access jarfile "/home/remus32/.remus32/sbt/sbt/bin/sbt-launch.jar"
but the path is correct, when i try to run it in terminal it works, so where is the problem?
Upvotes: 0
Views: 1591
Reputation: 1936
I find two problems with your code:
-jar
one.The following works for me (I did modify the path to be that of a sbt-launch jar from my own system, obviously):
val a = Seq("java","-jar", "/Users/soong/Library/Caches/IntelliJIdea13/sbt/sbt-launch.jar")
val proc = Process(a)
proc.!<(
new ProcessLogger {override def buffer[T](f: => T): T = f
override def out(s: => String): Unit = println(s)
override def err(s: => String): Unit = println(s)
})
Upvotes: 2