grails(一)环境搭建

grails(一)环境搭建

1. 安装
下载grails
首页
http://grails.org/
下载页面
http://www.grails.org/Download
文件
grails-bin-1.0.3.zip

解开压缩得到grails-1.0.3文件夹,拷贝到tools下面
在系统的配置上加上:
GRAILS_HOME = D:\tool\grails-1.0.3
path中加入D:\tool\grails-1.0.3\bin;

在命令行中输入grails
得到如下欢迎信息证明安装成功
Welcome to Grails 1.0.3 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: D:\tool\grails-1.0.3

No script name specified. Use 'grails help' for more info or 'grails interactive
' to enter interactive mode

下载 IntelliJ IDEA
首页
http://www.jetbrains.com/idea/
WINDOWS版本文件
http://www.jetbrains.com/idea/download/download_thanks.jsp?os=win
文件
idea-7.0.4.exe

安装后破解

然后安装groovy插件,点击Open Plugin Manager
在Available里面搜索 jetgroovy ,右键 download and install

2.新增项目
create project from scratch
选择grails Application
选择jdk路径
选择安装grails的路径

选中项目
new----->grails------>grails controller
输入hello,选择grails-app/controllers目录,会在目录中生成HelloController.groovy文件
在文件中输入
def index = {
        render "hello,sillycat!"
}

在IDE的工具栏的Window---->Tool Windows----->Grails,打开运行的log窗口

Edit Configration里面增加一个easygrails,在Grails Parameters里面输入 run-app

直接启动,访问
http://localhost:8080/easygrails 就可以访问到刚才的hellocontroller,看到hello,sillycat的页面了。




你可能感兴趣的:(windows,OS,grails,groovy,idea)