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/’


1 Response to “JAVA_HOME is not defined correctly”

  1. 1 rahul December 21, 2010 at 6:03 am

    JAVA_HOME is not defined correctly pls provide solution for the same.

Leave a Reply

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

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


Connecting to %s

April 2008
« Jan    

Blog Stats

  • 6,280 hits

Flickr Photos


%d bloggers like this: