Grails(I)Win7 64 bit Enviroment

Grails(I)Win7 64 bit Enviroment

1. download and install groovy
download the file from here http://groovy.codehaus.org/Download

the file name is groovy-1.8.1.zip, unzip the file and copy to working directory
GROOVY_HOME=D:\tool\groovy-1.8.1
and path adding D:\tool\groovy-1.8.1\bin;

C:\Users\luohua>groovy -v
Groovy Version: 1.8.1 JVM: 1.6.0_26

2. download the installation grails
http://www.grails.org/Download
file name is grails-bin-1.4.0.M1.zip

unzip the file and copy it to the working directory
D:\tool\grails-1.4.0.M1

configure it in my environment.
GRAILS_HOME = D:\tool\grails-1.4.0.M1
path adding D:\tool\grails-1.4.0.M1\bin;

type grails in command window
C:\Users\luohua>grails
Welcome to Grails 1.4.0.M1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: D:\tool\grails-1.4.0.M1

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

3. configure and use IntelliJ IDEA
download the file ideaIC-10.5.1.exe from here http://www.jetbrains.com/idea/

install the file in my working directory.

open the plugin manager and install some plugins
InspectorGroovy  -----  download and install

4. Create a sample project
>grails create-app grailsexample
>cd grailsexample
>grails integrate-with --intellij

then we can import the grails project to IDEA

5. Download and install netbean7
download the file from here http://netbeans.org/downloads/index.html

The file named netbeans-7.0-ml-windows.exe.

Change the netbean from cn_ZH to en_US

Enter the directory NETBEAN_HOME/etc/ and find the configuration file netbeans.conf
netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true
-J-Dsun.java2d.noddraw=true -J-Duser.language=en -J-Duser.country=US"

-J-Duser.language=en -J-Duser.country=US is what I added in the line.

6. Try to create a store in netbean7
create a grails application project  ----> groovy -----> grails application----> type name and click 'finish'

create new Domain Class in 'Domain classes' ----> type domain class name 'Book' and click 'finish'

edit Book.groovy to have two column title and author

edit BootStrap.groovy>
def init = { servletContext ->
        new grailsdemo.Book(author:"Stephen King",title:"The Shining").save()
        new grailsdemo.Book(author:"James Patterson",title:"Along Came a Spider").save()
    }

Create a Controller class in 'Controller' ----> type the name 'Book' and click 'finish'

edit BookController.groovy>
//def index = { }
def scaffold = Book

Select the project and click 'Run' to run the application.

This is the test URL.
http://localhost:8080/grailsdemo/book/list

references:
http://grails.org/Installation
http://hi.baidu.com/luohuazju/blog/item/90691694a3498218d21b708c.html
http://hi.baidu.com/luohuazju/blog/item/8947e38bbb13b915c8fc7a05.html
http://plugins.intellij.net/plugin/?id=1524
http://flashcloud.iteye.com/blog/870393
http://hi.baidu.com/dianjinglong/blog/item/e9fe2dc2236d551d0ef47780.html
http://hi.baidu.com/h819/blog/item/00cbae39800944f73a87ce42.html/cmtid/61346adf5109001e62279868
http://www.grails.org/NetBeans+Integration

你可能感兴趣的:(grails)