9

I have recently upgraded my IntelliJ 10 to the latest 11.0.1 version. I am writing grails app and until I was using the older version of IntelliJ everything was fine, however 11 doesn't allow me to successfully add Grails SDK (2.0.0) - I was trying to add the framework support, this however doesn't seem to be persisted (after adding Groovy and then choosing Grails - nothing happens). I have tried to follow those steps as well: IntelliJ IDEA 9.0 - unable to select project SDK for Grails application

I would be grateful if someone would be able to point me how to configure Grails SDK - or what could be wrong in my configuration.

Thanks,


This is exactly the way that I have my global library defined and still I was having exactly the same issue.

I followed OverZealous advice and created a new Grails project named exactly the same as the original one and boom everything is fine now! Thanks for help.

Community
  • 1
  • 1
karruma
  • 768
  • 1
  • 12
  • 32
  • Thanks for this update, it helped me; I also had to create a new Grails project exactly named as the original and then copy the *.iml and .idea files over for IdeaJ 13 EAP to again understand that it is a Grails project. – John M Nov 28 '13 at 10:57

2 Answers2

17

You don't need both Groovy and Grails for Grails project, just use Grails SDK. When creating a new Grails project 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.

Grails library configuration contains all the jars from GRAILS_HOME\dist and GRAILS_HOME\lib, plus all the jars from the src directory.

grails global library

grails dependency


In other words, it's not configured as a framework, it's just a library with all the jars from Grails distribution added to the module dependencies.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
  • 1
    A note: It is easy to manually create a global library for grails 1.3.7 or earlier; just add the jar libs like you mentioned. However, I found that the file structure changed too much in Grails 2.0 (lots of subdirectories under libs), so it's best to let IntelliJ create the library by creating a new Grails project. – OverZealous Jan 17 '12 at 07:41
  • Follow the project specific path : 'Create' as stated in this answer; Trying to add from `Global libraries` will not work – Ujjwal Singh Dec 06 '15 at 21:02
0

Each time I restart IntelliJ, version 13.1.2, it loses the SDK configuration. If I right-click on the project and "Add Framework Support" I can choose the SDK that is already configured and it will begin functioning properly. When it loses this setting, it won't allow me to compile or launch the app with grails. I reject the ideas to recreate the project, (been there/done that) as I have many dependent modules I have to verify and I lose all my run configurations that I've setup manually. I'm posting the "Add framework support" step here so it might help someone else; hopefully a more permanent solution for you, but its temporary in my situation

Duane5000
  • 33
  • 6
  • This happens to me too, and for years I've read "add framework support" on the project. But... what 'framework support' do I choose? Grails is not there (never has been, for the past 3 years) even though the grails plugin is installed. This is maddening - the grails view just *vanishes* from a project now and then. – kimsal Jul 11 '14 at 13:37
  • IntelliJ recommends installing the EAP version - "Early Access", or a fancy name for be-our-beta-tester. Poor choice for a subscribed user, but I don't have much for options otherwise. The EAP does appear to be stable though. Good luck! – Duane5000 Jul 25 '14 at 17:10