-
Notifications
You must be signed in to change notification settings - Fork 26
Getting Started Setup
Previous Getting Started Guide page 2 of 14. Next
To create an sbt project, you'll need to take these steps:
- Install sbt and create a script to launch it.
- Setup a simple hello world project
- Create a project directory with source files in it.
- Create your build definition.
- Move on to running to learn how to run sbt.
- Then move on to .sbt build definition to learn more about build definitions.
You need two files; sbt-launch.jar and a script to run it.
Download sbt-launch.jar and place it in ~/bin
.
Create a script to run the jar, by placing this in a file called sbt
in your ~/bin
directory:
java -Xmx512M -jar `dirname $0`/sbt-launch.jar "$@"
Make the script executable:
$ chmod u+x ~/bin/sbt
Use either MacPorts:
$ sudo port install sbt
Or HomeBrew:
$ brew install sbt
There is no need to download the sbt-launch.jar separately with either approach.
Create a batch file sbt.bat
:
set SCRIPT_DIR=%~dp0
java -Xmx512M -jar "%SCRIPT_DIR%sbt-launch.jar" %*
and put sbt-launch.jar in the same directory as the batch file. Put sbt.bat
on your path so that you can launch sbt
in any directory by typing sbt
at the command prompt.
If you have any trouble running sbt
, see Setup Notes on terminal encodings, HTTP proxies, and JVM options.
To install sbt, you could also use this fairly elaborated shell script: https://github.com/paulp/sbt-extras (see sbt file int the root dir). It has the same purpose as the simple shell script above but it will install sbt if necessary. It knows all recent versions of sbt and it also comes with a lot of useful command line options.
Move on to create a simple project.