1. 确保安装JDK,光有JRE不行
2. 在Grails官网下载Grails,解压,在环境变量path中添加其路径
3. Grails 自带服务器和数据库
4. 打开cmd,到一个空的目录下,比如“D:”
5. grails create-app helloGrails
6. cd helloGrails
7. grails,进入 interactive mode
8. 修改 Hello.groovy
package hellograils
class Hello {
String toWho;
Date whatTime;
static constraints = {
}
}
9. generate-all hellograils.Hello,要全名,而且包名居然是小写的
10. runApp
11. 访问 http://localhost:8080/helloGrails,Over
附图