English

Create Play Java Project

This tutorial is going to show you how to create a Play Java project using the command line build tool SBT in simple steps.

Create a Workspace

First, create a workspace in order to keep things organised:

mkdir play-workspace
cd play-workspace

Create the Play Java project

Next, run the commands below to invoke the wizard for new projects:

sbt new playframework/play-java-seed.g8

After loading plugins and some processing, you will be prompted to type your project details. For starters, just set the name and the organization like the example below:

This template generates a Play Java project 

name [play-java-seed]: play-java-lab   
organization [com.example]: com.bgasparotto
scala_version [2.12.4]: 
play_version [2.6.12]: 
sbt_version [1.0.4]: 

Template applied in ./play-java-lab

Run your project

Go the folder created by the previous commands: cd play-java-lab

Launch your application with SBT:

sbt run

...
--- (Running the application, auto-reloading is enabled) ---

[info] p.c.s.AkkaHttpServer - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

(Server started, use Enter to stop and go back to the console...)

Go to http://localhost:9000 and you should see the following:

To stop the server, just hit Enter or Ctrl + C.

Hope it helps. Cya!

bgasparotto

Recent Posts

Python function decorator

This guide will show you how to create a Python function decorator with a few…

2 years ago

Got permission denied while trying to connect to the Docker daemon socket

This guide will show you how to fix the error Got permission denied while trying…

2 years ago

Python virtual environment on Intellij IDEA

This guide will show you how to create a Python virtual environment on Intellij IDEA…

2 years ago

Find and kill processes on Linux and Mac by port number

This tutorial will quickly show you how to to find and kill processes on Linux,…

2 years ago

Python: Relocation R_X86_64_PC32 against symbol can not be used when making a shared object Error

This guide shows a possible solution for Python error Relocation R_X86_64_PC32 against symbol can not…

2 years ago

Kubernetes useful commands

I condensed below a cheat sheet of Kubernetes useful commands. I will keep updating this…

2 years ago