$ wget http://downloads.typesafe.com/play/2.2.0/play-2.2.0.zip
$ unzip play-2.2.0.zip
$ sudo mv play-2.2.0 /usr/local
$ cd /usr/bin
$ sudo ln -s /usr/local/play-2.2.0/play play
■動作確認
12345678910111213141516171819202122232425
$ play
zsh: correct 'play' to 'aplay' [nyae]? n
Getting com.typesafe.play console_2.10 2.2.0 ...
:: retrieving :: org.scala-sbt#boot-app
confs: [default]
6 artifacts copied, 0 already retrieved (2012kB/93ms)
Getting Scala 2.10.2 (for console)...
:: retrieving :: org.scala-sbt#boot-scala
confs: [default]
5 artifacts copied, 0 already retrieved (24390kB/2078ms)
_
_ __ | | __ _ _ _
| '_ \| |/ _' | || |
| __/|_|\____|\__ /
|_| |__/
play 2.2.0 built with Scala 2.10.2 (running Java 1.6.0_18), http://www.playframework.com
This is not a play application!
Use `play new` to create a new Play application in the current directory,
or go to an existing application and launch the development console using `play`.
You can also browse the complete documentation at http://www.playframework.com.
$ play new testPlay
zsh: correct 'play' to 'aplay' [nyae]? n
_
_ __ | | __ _ _ _
| '_ \| |/ _' | || |
| __/|_|\____|\__ /
|_| |__/
play 2.2.0 built with Scala 2.10.2 (running Java 1.6.0_18), http://www.playframework.com
The new application will be created in /home/philippos/testPlay
What is the application name? [testPlay]
>
Which template do you want to use for this new application?
1 - Create a simple Scala application
2 - Create a simple Java application
> 1
OK, application testPlay is created.
Have fun!
$ tree testPlay
testPlay
|-- README
|-- app
| |-- controllers
| | `-- Application.scala
| `-- views
| |-- index.scala.html
| `-- main.scala.html
|-- build.sbt
|-- conf
| |-- application.conf
| `-- routes
|-- project
| |-- build.properties
| `-- plugins.sbt
|-- public
| |-- images
| | `-- favicon.png
| |-- javascripts
| | `-- jquery-1.9.0.min.js
| `-- stylesheets
| `-- main.css
`-- test
|-- ApplicationSpec.scala
`-- IntegrationSpec.scala
10 directories, 14 files
■playアプリケーションの実行
1234567891011121314151617
$ play run
[info] Loading project definition from /home/philippos/testPlay/project
[info] Set current project to testPlay (in build file:/home/philippos/testPlay/)
Cannot load the JNotify native library (/home/philippos/testPlay/target/native_libraries/64bits/libjnotify.so: /lib/libc.so.6: version `GLIBC_2.12' not found (required by /home/philippos/testPlay/target/native_libraries/64bits/libjnotify.so))
Play will check file changes for each request, so expect degraded reloading performace.
--- (Running the application from SBT, auto-reloading is enabled) ---
[info] play - 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...)
[info] Compiling 5 Scala sources and 1 Java source to /home/philippos/testPlay/target/scala-2.10/classes...
[info] play - Application started (Dev)
$ play console [21:19:14]
[info] Loading project definition from /home/philippos/testPlay/project
[info] Set current project to testPlay (in build file:/home/philippos/testPlay/)
[info] Starting scala interpreter...
[info]
Welcome to Scala version 2.10.2 (OpenJDK 64-Bit Server VM, Java 1.6.0_27).
Type in expressions to have them evaluated.
Type :help for more information.