I'm trying to get system path, where jar is located in run time.
Below code works in REPL but, it fails if I assemble jar using sbt,
object tboj {
def main(args: Array[String]) {
def getCurrentDirectory = new java.io.File(".").getCanonicalPath
val pwd = getCurrentDirectory
println(pwd)
}
}
SBT error as below,
run java.lang.RuntimeException: No main class detected. at scala.sys.package$.error(package.scala:27) [trace] Stack trace suppressed: run last compile:run for the full output. [error] (compile:run) No main class detected. [error] Total time: 0 s, completed 13 Apr, 2016 5:15:40 PM