playframework Java - Hello World The first run


When we created our project, Activator told us how we can run our application

To run "HelloWorld" from the command line, "cd HelloWorld" then:
    /home/YourUserName/HelloWorld/activator run

There is a small pitfall here: activator executable is not in our project root, but in bin/activator. Also, if you changed your current directory to your project directory, you can just run


Activator will now download the required dependencies to compile and run your project. Depending on your connection speed, this can take some time. Hopefully, you will be presented with a prompt

[HelloWorld] $ 

We can now run our project using ~run: this will tell Activator to run our project and watch for changes. If something changes, it will recompile the needed parts and restart our application. You can stop this process pressing Ctrl+D (goes back to Activator shell) or Ctrl+D (goes to your OS shell)

[HelloWorld] $ ~run

Play will now download more dependencies. After this process is done, your app should be ready to use:

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

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

(Server started, use Ctrl+D to stop and go back to the console...)

When you navigate to localhost:9000 in your browser you should see the Play framework starting page

enter image description here

Congratulations, you are now ready to make some changes in your application!