IntelliJ IDEA 9.0 - unable to select project SDK for Grails application
Asked Answered
C

3

9

I'm convinced that I'm just having a bad day and missing something obvious. I'm trying to create a new Grails project in IntelliJ IDEA 9.0 and I am unable to associate it with an SDK. I've tried creating a project from scratch and creating a project from existing sources. In either case, I get to the "Please select project JDK" screen and my only options are:

  • JSDK
  • IntelliJ IDEA Plugin SDK
  • Mobile SDK
  • Flex SDK
  • AIR SDK
  • Flexmojos SDK

Select project JDK http://img521.imageshack.us/img521/5793/idea1n.jpg

When I used IntelliJ IDEA 8.1.3, it would ask me the same thing and I would simply navigate to C:\Grails and everything worked fine. I've even tried adding the SDK in the following locations, but to no avail.

  • File -> Project Structure -> Project Settings -> Project SDK -> New
  • File -> Project Structure -> Platform Settings -> SDKs -> Add New SDK

I'm missing something really obvious, right?

Coenosarc answered 16/12, 2009 at 15:3 Comment(2)
I didn't realize I had the option to hit "Next" without selecting a project JDK. I did that and the next screen prompted me for the Grails SDK, which I was able to select. However, I seem to think it should still be necessary to select a JDK. I selected JSDK and was able to point to my jdk1.6.0_17 directory, but is that the right thing to do? Aren't JSDKs only for servlet development? Now I am just confused.Coenosarc
It's not for servlets, it's J2SE IDEA is asking you for, a JVM to run your Groovy code under.Williford
N
20

They Changed the way that this is done in Intellij 9.0. You are going to want to right-click on the Module and click "Add Framework Support"

Add Framework Support

This will bring up a dialog where you can select a new Groovy SDK. Choose your Grails Location and hit OK.

Framework Support Dialog

http://www.jetbrains.com/idea/webhelp/adding-frameworks-support.html

http://www.jetbrains.com/idea/webhelp/frameworks-support.html

Nitrite answered 16/12, 2009 at 16:34 Comment(1)
Wow. That worked. Am I crazy or is that a step backward in terms of usability? In any case, I thank you very much for your prompt answer. There are still a few things bugging me with this new release, but at least I got this part down. Thanks again!Coenosarc
T
1

Unfortunately, it isn't quite a simple as that. It appears your GROOVY_HOME needs to point to the version of Groovy you actually wish to use, and when defining the Global Groovy library, you need to make sure you add the individual jar files, not the whole jar directory (otherwise IDEA doesn't recognize its a Groovy install).

Tybie answered 11/6, 2010 at 22:22 Comment(0)
D
0

Recently, I've encountered a similar type of issue. I have the grails SDK folder, but OK Button not enabled when trying to configure from the project. Then we have installed the Grails Plugin in IntelliJ. Then OK Button enabled and grails SDK is configured into project.

Duran answered 14/8, 2022 at 6:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.