Getting Started

Update

Please refer to the Liftweb.net site for updated getting started instructions

This Getting Started Guide provides you all need to know to create a simple web application with Lift. First we will take a look at the prerequisites and then we will show you how to create and run a Lift project using different development environments. We won’t cover how to develop the Lift way, because that can be found in the User Guide.

Quick Start

Assuming you have Java 5 or higher installed, you can get a Lift web application running in three simple steps:

To understand more about what’s going on here, read on …

Prerequisites

Lift is written in Scala which is a modern programming language for the Java virtual machine. You need Java 5 or higher already installed for developing and running Lift projects.

Lift depends on the Servlet API 2.5, hence you need a suitable Servlet container to run a Lift-based web application, e.g. Jetty 6 or 7 or Tomcat 6. However, if you’re using the Lift Basic template , this comes with an embedded Jetty server, so installing a separate container isn’t necessary to get started.

Depending on which development environment you choose it might or might not be necessary to download the Scala distribution:

Lift itself is a collection of libraries that you add to your project, so other than downloading the libraries there is no initial ‘installation’ of Lift required. If you’re using a build tool such as SBT, the Lift libraries are downloaded automatically as part of your project’s build process.

Running Your First Lift Web Application.

The easiest way to get your first Lift web application up and running is to download the latest ‘Lift Basic’ template and use SBT to build.This template comprises a navigation bar, user management functionality , an index page demonstrating a dynamically generated ‘Hello World’ message and a placeholder for static content. So, it’s an ideal place to start experimenting with your own Lift code.

To get the Lift Basic template, if you’re using Git:

git clone git://github.com/lift/lift_25_sbt.git

or without Git, manually download and extract the zip or tar. Then, to build and run:

cd lift_25_sbt/scala_29/lift_basic
./sbt (sbt.bat on windows)
sbt> container:start

The Lift Basic template comes with a SBT launcher, so there’s no need to install sbt separately. The command ‘sbt container:start’ will download all necessary libraries , compile the application, and then launch Jetty as an embedded application – there’s no need to install Jetty separately. You can then open http://localhost:8080 in a web browser to see the application running.

For more details on using SBT and other build tools see:

Next Steps

Other Sample Applications

git clone https://github.com/lift/examples.git
cd examples
./liftsh (Mac OS/Linux), or liftsh.cmd (Windows)

Wait for the SBT prompt and then:

sbt> projects
sbt> project lift-example (Choose the sample you want from the list)
sbt> update
sbt> jetty-run

Wait for the server to come up and open your browser to localhost:8080

Translations