Configuring Groovy SDK within IntelliJ IDEA

Carl Patenaude Poulin picture Carl Patenaude Poulin · Sep 8, 2017 · Viewed 55.6k times · Source

I am running IntelliJ IDEA 2017.2.3. I installed Groovy 2.4.12 via Homebrew (OS X). When I open a Groovy source file (or a Jenkinsfile), I get the following:

Groovy SDK is not configured for module 'my-module' . . . . . Configure Groovy SDK...

Clicking "Configure Groovy SDK..." leads me to the following dialog:

Error: library is not specified

I tried hitting "Create..." and selecting many different Groovy-related folders and executables, but nothing works.

How can I get IntelliJ IDEA to accept my Groovy SDK?

Answer

CrazyCoder picture CrazyCoder · Sep 9, 2017

IntelliJ IDEA expects the standard Groovy SDK layout which is provided with the official distributions available at http://groovy-lang.org/download.html. Just download, unpack into any directory, specify this directory as the library home.

Homebrew package layout may be different, however it may have the standard layout in the libexec subdirectory in some cases. Try /usr/local/opt/groovy/libexec.