You can also create a task to create a file to launch the app. @Kipton Barros posted this in How do I run an sbt main class from the shell as normal command-line program?:
val MkUnixlauncher = config("mkunixlauncher") extend(Compile)
val mkunixlauncher = TaskKey[Unit]("mkunixlauncher")
val mkunixlauncherTask = mkunixlauncher <<= (target, fullClasspath in Runtime) map { (target, cp) =>
def writeFile(file: File, str: String) {
val writer = new PrintWriter(file)
writer.println(str)
writer.close()
}
val cpString = cp.map(_.data).mkString(System.getProperty("path.separator"))
val launchString = """
CLASSPATH="%s"
scala -usejavacp -Djava.class.path="${CLASSPATH}" "$@"
""".format(cpString)
val targetFile = (target / "scala-sbt").asFile
writeFile(targetFile, launchString)
targetFile.setExecutable(true)
}
That creates a file named scala-sbt in your target directory that has the classpath set properly to run the app. Tweak to taste.