Lift Tutorial 1: Development Environment Setup

What this tutorial will cover

Operating System

I will write down instructions for Mac OS X. But for Windows or Linux the instructions might only differ slightly.

Create basic lift project with SBT (Simple Build Tool)

With SBT we will be managing our lift project. It helps us to do several tasks pretty easy. The easiest way to start with Lift and SBT is to download a sample SBT Lift project from https://github.com/lift/lift23sbt . On that site click on “Downloads” on the right to download it as .tar.gz or .zip. Then choose one of the folders depending on what you want to do. You can choose lift_basic to see an example.

I prefer git and will handle my project with git so I do the following to download the default example:

Run the basic project

Go into the folder myLiftProject and rund the following commands. Some of them will take quite some time.

sbt update
sbt ~jetty-run

~jetty-run will start jetty to run your project. Go to http://127.0.0.1:8080/ and you will see the web site up and running. If you change anything in the code it will automatically notice that and compile it. A few seconds later you see the change reflected on the site. Use CTRL+C to stop it from executing.

.war file

If you want to package your project as a .war to put it on your web server, run “sbt package”.

Working on the code

Well there are several ways to work on the lift (scala) code. You can use vim, eclipse or IntelliJ IDEA. I will quickly explain how to work with eclipse and IntelliJ IDEA community edition (both free tools)