Hello World in Grails on Windows

Grails is Groovy based framework for web development using Model-View-Controller design pattern. The idea is to get started with Grails Framework on windows platform. This is a very simple “Hello World” application which I created on Windows 7.

Following steps should be taken to get started to write your very first application.

1. Install JDK from http://www.oracle.com/technetwork/java/javase/downloads/index.html

2. Check to see if java is installed fine:

3. Download Grails from http://grails.org/Download

4. Unzip the file at C:\opt\grails location

5. Create a new Environment Variables  as GRAILS_HOME, JAVA_HOME as:


6. Edit the path by appending %GRAILS_HOME%\bin

7. Verify that Grails installed properly by writing “grails” in the command prompt

 

9. Navigate to wherever you want to create your project from command prompt. Example, I created my project inside “D:\Projects” folder

grails create-app helloworld
Navigate to Project Folder
All the folders are created magically inside D:\Projects\helloworld
Folder Structure

10. Next step is to run the application through command prompt. Navigate inside helloworld folder and write
grails run-app

Run Application

11. Browse http://localhost:8080/helloworld/ at browser

12. Open the file D:\Projects\helloworld\grails-app\views\index.gsp in any text editor and change it to see the changes on the browser

I hope this gives you fairly good idea to get started with Grails Framework for the beginners.

Advertisements

4 thoughts on “Hello World in Grails on Windows

  1. Good information, but keeping your projects under the Grails install directory will be a problem when you upgrade. Instead, put them in a ‘projects’ or ‘workspace’ folder that’s separate from GRAILS_HOME

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s