If you have the prerequisites installed and are familiar with sbt, follow the steps below to create a Hello World project. Otherwise, see detailed instructions for help setting up the prerequisites and getting started. Prerequisites for using Lagom with sbt include:
- JDK 8
- sbt 0.13.13
The Lagom Giter8 template makes it easy to get started. The template downloads all dependencies and creates the basic project structure. It can take a few seconds to a few minutes to complete.
After confirming the prerequisites, open a console or command window and follow these steps:
Create a new directory for your project.
Change into the new directory and enter the following:
sbt -Dsbt.version=0.13.15 new https://github.com/lagom/lagom-java.g8
The sbt Lagom template prompts for the following parameters. Press
Enterto accept the defaults for the following:
name- Becomes the name of the top-level directory.
organization- Used as a package name.
version- A version number for your system.
lagom_version- The version number of Lagom. Be sure to use the current stable release (1.3.5)
Change into the top-level directory of the project you just created. For example, if you used the default name,
Start sbt and the Lagom development environment:
It will take a bit of time for the services to start. When finished, the console displays the message 'Services started, ...'. Verify that the services are indeed up and running by invoking the
helloservice endpoint from any HTTP client, such as a browser: http://localhost:9000/api/hello/World
The request returns the message
Congratulations! You've created and run your first Lagom system. See the documentation to understand your new project.