IntelliJ 11 - Grails SDK is not configured

2019-01-23 07:49发布

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.

2条回答
倾城 Initia
2楼-- · 2019-01-23 08:11

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

查看更多
祖国的老花朵
3楼-- · 2019-01-23 08:16

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.

查看更多
登录 后发表回答