play-1.2.x 开发环境搭建
2016-06-24 20:34
441 查看
摘要: Eclipse、idea开发环境搭建
使用
此时,
2.进入到项目的根目录,使用dir命令查看下项目的目录结构,此时多出了目录
此步骤可省略,通过idea导入Module的时候选择新建即可,或者选择eclipse项目
2.
3.运行环境配置
1.选择工具栏上的
2.配置默认
3.点击左上角
4.打开
5.点击工具栏中的
建立play项目
play的环境变量配置同
java的环境变量配置差不多,将
play的主目录添加
path环境变量中即可。
使用
play new命令创建一个新的项目。
$ play new test set JAVA_OPTS=-Xmx1024m -Xms1024m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:-UseSplitVerifier -Xdebug -Dplay.debug=yes -Dplay.id=test -Dapplication.path="." ~ _ _ ~ _ __ | | __ _ _ _| | ~ | '_ \| |/ _' | || |_| ~ | __/|_|\____|\__ (_) ~ |_| |__/ ~ ~ play! 1.2.7, http://www.playframework.org ~ ~ The new application will be created in C:\Users\Jie\play\test ~ What is the application name? [test] test(输完回车确认) ~ ~ OK, the application is created. ~ Start it with : play run test ~ Have fun! ~
此时,
play项目创建完成,但是此时还不能直接导入到编辑器中,还需要创建编辑器所必须的目录和文件才可以,先使用
dir命令看看当前项目的目录结构。
导入到编辑器中
eclipse
先进入到项目的上一级目录,然后使用play eclipsify 项目名称创建
eclipse编辑器所需的文件。
$ cd test $ play eclipsify test set JAVA_OPTS=-Xmx1024m -Xms1024m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:-UseSplitVerifier -Xdebug -Dplay.debug=yes -Dplay.id=test -Dapplication.path="." ~ _ _ ~ _ __ | | __ _ _ _| | ~ | '_ \| |/ _' | || |_| ~ | __/|_|\____|\__ (_) ~ |_| |__/ ~ ~ play! 1.2.7, http://www.playframework.org ~ ~ OK, the application "test" is ready for eclipse ~ Use File/Import/General/Existing project to import C:\Users\Jie\play\test into eclipse ~ ~ Use eclipsify again when you want to update eclipse configuration files. ~ However, it's often better to delete and re-import the project into your workspace since eclipse keeps dirty caches... ~
2.进入到项目的根目录,使用dir命令查看下项目的目录结构,此时多出了目录
.classpath、
.project文件和、
.settings、
eclipse目录,接下来要做的只需要通过
eclipse的
import功能导入项目即可。
2016/06/18 15:46 6,330 .classpath 2016/06/18 15:46 443 .project 2015/04/21 19:49 <DIR> .settings 2016/06/18 15:38 <DIR> app 2016/06/18 15:38 <DIR> conf 2016/06/18 15:46 <DIR> eclipse 2016/06/18 15:38 <DIR> lib 2016/06/18 15:38 <DIR> public 2016/06/18 15:38 <DIR> test
idea
1.cd ../project,使用
play idealize 项目名称创建
idea编辑器所需要的目录和文件。
此步骤可省略,通过idea导入Module的时候选择新建即可,或者选择eclipse项目
$ play idealize test set JAVA_OPTS=-Xmx1024m -Xms1024m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:-UseSplitVerifier -Xdebug -Dplay.debug=yes -Dplay.id=test -Dapplication.path="." ~ _ _ ~ _ __ | | __ _ _ _| | ~ | '_ \| |/ _' | || |_| ~ | __/|_|\____|\__ (_) ~ |_| |__/ ~ ~ play! 1.2.7, http://www.playframework.org ~ ~ OK, the application is ready for Intellij Idea ~ Use File, Open Project... to open "test.ipr 3ff0 "
2.
cd project,使用
dir命令看看项目的目录结构,发现多出了
test.iml、
test.ipr文件,这两个文件是
idea编辑器所需要的文件,接着将项目导入
idea中即可。
2016/06/18 16:00 <DIR> app 2016/06/18 16:00 <DIR> conf 2016/06/18 16:00 <DIR> lib 2016/06/18 16:00 <DIR> public 2016/06/18 16:00 <DIR> test 2016/06/18 16:00 1,952 test.iml 2016/06/18 16:00 479 test.ipr
3.运行环境配置
1.选择工具栏上的
Edit Configurations
2.配置默认
application > Configuration项
// Main class 配置此项应当提前将jar加入Module中,否则将会提示错误,可先保存后续加入play-1.2.x.jar play.server.Server // VM options -Xmx1024m -Xms1024m -XX:PermSize=256m -XX:MaxPermSize=512m -XX:-UseSplitVerifier -Xdebug -Dplay.debug=yes -Dplay.id=test -Dapplication.path="." //Working directory 填写项目根目录 //JRE 选择jdk版本
3.点击左上角
+新建
applicaton,仅需修改
Working directory(多模块为主Module根目录)、
Use classpath of module(主Module)项即可
4.打开
Project Structure项目配置弹框,选择左侧
Modules项,右侧选择
主Module > sources,将
public、conf目录设置为
Resources,不需要在idea中搜索到或显示的目录设为
Excluded即可,其他模块也应该一一设置。
5.点击工具栏中的
Debug绿色图标启动项目即可
相关文章推荐
- java对世界各个时区(TimeZone)的通用转换处理方法(转载)
- java-注解annotation
- java-模拟tomcat服务器
- java-用HttpURLConnection发送Http请求.
- java-WEB中的监听器Lisener
- Android IPC进程间通讯机制
- Android Native 绘图方法
- Android java 与 javascript互访(相互调用)的方法例子
- 介绍一款信息管理系统的开源框架---jeecg
- 聚类算法之kmeans算法java版本
- java实现 PageRank算法
- PropertyChangeListener简单理解
- c++11 + SDL2 + ffmpeg +OpenAL + java = Android播放器
- 插入排序
- 冒泡排序
- 堆排序
- 快速排序
- 二叉查找树