Archive for April, 2008

JAVA_HOME is not defined correctly

I have been working with Grails and Groovy for the last little while and have started to use IntelliJ as my ide of choice since NetBeans Groovy/Grails support is still pending release. I did have an issue getting intelliJ to work though and I found someone else who had the same problem but also had the solution:


Tip for using Grails in Idea

Recently I tried creating my first Grails application using the JetGroovy plugin available in Idea (version 7.0). However, I have Linux (Ubuntu 7.10) and you don’t get those nice little icons to start Idea when you install it. Consequently when I tried to create a new Grails project I received the following error:

grails: JAVA_HOME is not defined correctly; can not execute: java

How in the world is that possible I thought to myself? What half decent java programmer doesn’t have JAVA_HOME set? Oh but then I remembered my special start script responsible for starting Idea. Idea requires the variable JDK_HOME to be set, but Grails within Idea needs JAVA_HOME. Therefore, here is my new script I use to start Idea 7 which allows me to create new Grails projects. And don’t forget Idea 7 on Linux requires JDK 1.6.

sh -c ‘export JDK_HOME=/workspace/java/jdk1.6.0_03;export JAVA_HOME=/workspace/java/jdk1.5.0_12;/workspace/java/idea-7361/bin/’