This is an excerpt from the Scala Cookbook (partially modified for the internet). This is Recipe 18.2, “How to compile, run, and package a Scala project with SBT.”
You want to use SBT to compile and run a Scala project, and package the project as a JAR file.
Create a directory layout to match what SBT expects, then run
sbt compile to compile your project,
sbt run to run your project, and
sbt package to package your project as a JAR file.