问题
I feel like I'm missing something simple at this point. I upgraded to grails 2.1.1 from 1.3.7 while running IntelliJ 10, recently I upgraded to IntelliJ 12 and imported all settings. Somehow in the project in IntelliJ 12, I have no grails SDK.
My Global Library has grails 2.1.1 defined with all the correct .jars included, however, the Tools menu is missing the "Grails" sub-menu, and attempting to run the app gives the error message that Grails SDK is not configured.
If I create a new project for grails, the SDK configures correctly and Grails shows in the Tools menu. What am I missing preventing me from adding the Grails SDK to this project? Thank you, community, for your time and suggestions.
回答1:
You do not have to create a new project.
Had the same problem, and it took me quite some search to resolve it:
- right click your Grails module
- click "Add framework support"
- select "Groovy"
- The dropdown next to "Use library" will allow you to choose a grails library.
- If the dropdown is empty press "create" and choose your grails library directory.
- Grails SDK is configured then


回答2:
With Intellij 16 right click on your project in the right hand project pane.
Choose Grails->Configure Grails SDK.
If you're using the grails wrapper I would point to that SDK:
/Users/your user/.grails/wrapper/2.5.2/grails-2.5.2
回答3:
I have the IntelliJ 12 too, to run app i just click in 'File' -> 'Create Project', select 'Grails Project

Click Next,

Click em Create, select the folder, who contain the Grails 2, and Voila. :-)
If you has the project before, run in project 'grails integrate-with --intellij' or run import project, and create a Grails SDK
回答4:
I found a symlink that points to the latest version in:
~/.sdkman/candidates/grails/current
I'm using SDKMAN 4.0.37
Pointing Intellij at that location will allow you to switch versions using sdkman.
回答5:
Not really an "answer" here, but after seeing similar troubles with IDEA I went ahead and just created a new project and copied my source in and resolved my issues, if not solving the actual problem.
回答6:
I am working with IntelliJ 12.0.1 ultimate. I have installed Grails 2.3.1 on my computer, but always got errors when trying to specify it as a Grails SDK- "failed to create library. Looks like Grails distribution in specified path is broken. Cannot determine version." I tried with Grails 2.3.0, but got the same error. Then, I tried my luck with Grails 2.2.4, and I could finally get it work.
回答7:
Creating a New Project will actually not overwrite any existing code; just point it at your existing project directory, select Grails and open it up.
Your project will now complain that there is no Grails SDK; just point it at your Grails dist and you are good to go.
来源:https://stackoverflow.com/questions/14757758/intellij-12-grails-2-1-configuration-grails-sdk-not-configured