- Download and Install the Java Software Development Kit (SDK).
- log on to http://developer.apple.com
- Search for “Java for Mac OS X 10.7 Developer ” on the downloads page
- Download and Install the latest. This will be a .pkg type install (not click and drag)
- Install Grails
- Go to http://grails.org/Download
- Download the “Binary Zip” under the current release.
- Unzip the downloaded file, and move to /Applications/Dev (or wherever you like), take note of the directory name.
- Add Environment Variables
- Open/Create /etc/launchd.conf
sudo nano /etc/launchd.conf
- Add the following lines: (make sure to reference the proper directory names)
setenv JAVA_HOME /Library/Java/JavaVirtualMachines/[VERSION].jdk/Contents/Home setenv GRAILS_HOME /Applications/Dev/[GRAILS VERSION]
- Save and Exit
- Add execute permissions
sudo chmod +x /etc/launchd.conf
- Append reference to the grails /bin directory to the path
- Create a new path file
sudo nano /etc/paths.d/grails
- Insert the following lines
/Applications/Dev/[GRAILS VERSION]/bin
- Save and Exit
- Restart the computer
You should be able to type ‘grails’ at the command prompt and get a response.
Since when are you a Java developer?
I’m not. I just wanted the challenge 🙂
Actually, I’m doing JavaScript on a Grails app as a side project.
Thank you, Devin!
I’ve forgotten how to find the Java SDK on Mac, now I’m testing Grails!