10

I'm trying to import in an existing grails project into Intellij but its not recognizing the SDK.

I already setup my paths in my home directory /.bash_profile here is what I got going in there.

export GRAILS_HOME=/Applications/grails-2.0.4
export PATH=$PATH:$GRAILS_HOME/bin

Now when I fire up Intellij and do a file > new Project > Create project from existing source I name my project then when I get to SDK there is no grails SDK. I presumed when I setup my path in the .bash_profile it would recognize the path to the grails SDK.

Any help on this would be great.

Chapsterj
  • 6,483
  • 20
  • 70
  • 124
  • Which version of IntelliJ? Do you need a Grails plug-in? Did you add the Grails SDK to your project? IntelliJ isn't looking for PATHs - you have to tell it. – duffymo May 24 '12 at 20:29
  • V 11.1.2 There is a grails SDK in the project. Does this mean I have to point it to that. – Chapsterj May 24 '12 at 21:41
  • Ok just realized I don't have the SDK. Is the SDK part of the grails-2.0.4 package I downloaded and if so whats the name of the file I need to import. I'm sorry if this sounds like a stupid question but I'm completely new to grails and Intellij and really need the help. thanks – Chapsterj May 25 '12 at 03:12
  • Download it here: http://grails.org/Installation – duffymo May 25 '12 at 09:02
  • I downloaded the 2.0.4 Binary Zip from here http://grails.org/Download but Intellij still doesn't recognize this SDK. When I try to import the SDK I went through every file in the grails-2.0.4 folder and it does not allow anything to be imported. This is driving me mad I can't seem to find anything about it. – Chapsterj May 25 '12 at 12:06
  • You should be able to point IntelliJ to the Grails SDK. I don't know what "import" means. I can't try it now; perhaps later. – duffymo May 25 '12 at 14:08

5 Answers5

16

Check is Grails plugin installed.

Go to Projects, right click to your project name > Grails > Configure Grails SDK.

Create SDK from there ...

arcseldon
  • 35,523
  • 17
  • 121
  • 125
Aram Arabyan
  • 2,339
  • 1
  • 17
  • 30
  • Where is projects. I only have File > new Project > create project from existing source. I already have a project source I just want to setup that project in my IDEA with a working SDK – Chapsterj May 25 '12 at 03:46
  • Ok I'm starting to feel really stupid now. How hard can it be to install a grails SDK. – Chapsterj May 25 '12 at 03:57
  • Here is where I'm at. file > new Project > Create project from existing source. click next > I name my project set my path > Click Next select SDK there is no grails SDK. I'm trying to find out how or where I can get my grails SDK. – Chapsterj May 25 '12 at 04:02
  • 1
    My only regret is that I have but one upvote to give. Thank you! – Eric Wendelin Jan 17 '13 at 20:53
4

What I've not seen here is the question if you use the Ultimate or Community version of Intellij? Because it's not possible to get Grails running in the Community version of Intellij - the plugin is only available within the Ultimate version...

Other than that, I had the problems myself that I couldn't find the Grails SDK to choose from when I want to select the SDK (within the Intellij Ultimate 12.0 version), but it is there, it's just hidding itself pretty well ;) *On the page where you can choose your SDK you have to choose Groovy AND Spring and voíla: you see your Grails SDK ready to be chosen (or even a Griffon SDK if you've installed it).*

herom
  • 2,532
  • 29
  • 41
0

intellij does not pick up your path setting for grails. You need to specify it in intellij. This give you the option of have different version of grails for different or the same project.

open up the project settings there is an option to add new SDK, select the home path of your Grails installation and it will be configured automatically as a Global Library and this library will be added as a dependency to your module.

this should help as well IntelliJ 11 - Grails SDK is not configured

Community
  • 1
  • 1
nate_weldon
  • 2,289
  • 1
  • 26
  • 32
0

Once the project is loaded, in the Event Log, you should see a message:

Grails SDK not found.: Module 'moduleNameHere' has no Grails SDK. Configure SDK

Clicking on Configure SDK opens a dialogue box. If no option is available, click create, and navigate to the location where your Grails is setup (my own was /opt/grails-2.2.0). Navigating there seems to be enough to satisfy the SDK requirements. I selected that folder, and IJ did the rest.

lordB8r
  • 370
  • 2
  • 12
0

This will be the usual path for Grails SDK when installing with homebrew. Change the and with what you have in you machine

/Users//.sdkman/candidates/grails/

eg:- /Users/tom/.sdkman/candidates/grails/2.4.3

Khader M A
  • 5,423
  • 3
  • 19
  • 19