On My Way with Grails

March 6, 2010

My newest foray in my “job within a job” is developing using Grails.  As I’ve been primarily been a .NET developer (using VB.NET and C#) this is both scary and exciting.  It’s all very close to Ruby on Rails, which I’ve played with (Grails is Groovy on Rails), but pretty brand new to me.  I’ve wanted to move to MVC (Model – View – Controller) programming for some time as it seems to be “the future.”

Since this IS all new, I’m going to try to document as I go along – I’ve spent the better part of yesterday and today just trying to figure out how to get set up, which I’ll try to cover here.

First I would download the Java Development Kit (JDK) and NetBeans 6.8

You’ll need them both, so download and install.  I would highly recommend either:

1. Setting up a dev enviroment on your PC with a different login 
2. Create a “DEV” folder somewhere where you install everything. 

Location is important, and you’ll want to know where everything is.  I did this a little late.

Once you install, you’ll need to set your “Enviroment Variables”.  If you haven’t done this before, I’ll run through it now.

Right click My Computer and select properties.

Add your JAVA_HOME first.

Your “Variable value:” will likely be different – and will be wherever you had installed the JDK.

The you need to append the %JAVA_HOME%\bin to the variable Path.

Look for “Path” and edit.  To the end you’ll add a semi-colon then %JAVA_HOME%\bin

Press OK to everything and you should be done with the Java portion.

Before we get to NetBeans, let’s install Grails and Groovy.

Download Grails here.

Unzip to something like I recommended before C:\DEV\Grails

Now, repeat the process that we did for Java and the Environment Variables using GRAILS_HOME and %GRAILS_HOME%\bin

To test, open a command prompt (Start>Run>cmd) and type “grails” – you should see the installed version.

Now on to Groovy.

Download here.

Be sure to download the JavaDoc as well!

Unzip to a folder (again)  C:\DEV\

The directory structure should look something like this, paying close attention to the JavaDoc (html folder) location.

Now, much like before add the Environment Variables like before (you’re getting used to this now, right?) using GROOVY_HOME and %GROOVY_HOME%\bin.

Again test with a command prompt and “groovy -v” showing the version.

Now NetBeans.

Install – sure, use your C:\DEV\ folder again.  It’ll likely ask for your Java install location which you should know from earlier.

Start it up and set it up to use Groovy and Grails by going to Tools>Options

Then to Miscellaneous and the Groovy tab.

Fill in as shown using YOUR location of files.

Press OK and now you’re finally ready to build your first app! I recommend you try this tutorial to start.

That’s it for now, but it took me a long time to get to this point, so I wanted to document and share.  Enjoy!

Zemanta helped me add links & pictures to this email. It can do it for you too.

Posted via email from Vince.DeGeorge

Advertisements

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s

%d bloggers like this: