1. 程式人生 > >play01-Getting started-Installing Play

play01-Getting started-Installing Play

Scala sbt Play

https://www.playframework.com/documentation/2.6.x/Home
Getting started

https://www.playframework.com/documentation/2.6.x/Installing

這個頁面將會告訴你如何下載,安裝的運行一個Play應用 。
有一個內置的程序會告訴你,play本身是如何工作 的。
Play系列相關的庫由Maven提供,所以你可以使用任何java的編譯工具,建立起項目。然而,大部分的開發經驗是已知的(路由,模板和自動加載)是由SBT提供。
本指南中我們描述了如何安裝使用SBT安裝Play

前提:
Play要使用java 1.8+ ,去檢查你的sdk,請運行

java -version:
java version "1.8.0_121"
Java(TM) SE Runtime Environment (build 1.8.0_121-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.121-b13, mixed mode)

如果沒有,請去Oracle官網下載安裝http://www.oracle.com/technetwork/java/javase/downloads/index.html

安裝Play和SBT
我們提供了一些簡單的demo,為unix和winodws下的sbt和sbt.bat. 這些例子可以在我們的下載頁面 到,它會自動下載相關的依賴包(https://playframework.com/download#examples)

https://www.scala-sbt.org/download.html  SBT下載,在這之前先去sbt官網下載並安裝好sbt

下載到項目後,進去:sbt run然後等上個半天,示例程序就能運行了
sbt可以使用代理:
./sbt -Dhttp.proxyHost=myproxy -Dhttp.proxyPort=8080 -Dhttp.proxyUser=username -Dhttp.proxyPassword=mypassword -Dhttps.proxyHost=myproxy -Dhttps.proxyPort=8080 -Dhttps.proxyUser=username -Dhttps.proxyPassword=mypassword

祝賀你!
現在你已經準備好使用Play~下一頁將會告訴你如何使用命令行創建項目和更多的詳細信息。(已經開始掉入坑裏了)

play01-Getting started-Installing Play