Add Groovy SDK to IntelliJ IDEA

From Bonus Bits
Jump to: navigation, search

Purpose

This article gives the steps to add Groovy SDK Path to Jetbrains IntelliJ IDEA 2016.x on macOS. To help with the confusion.

Jetbrains tends to make this confusing in IntelliJ IDEA because Groovy is called by several names. We download and install the Groovy SDK, but in IntelliJ IDEA it does not go under the SDKs section. Jetbrains names it a Framework and then places it under the Libraries Section of the app. Then there is the Groovy Compiler section under preferences. Hopefully, this quick example will get you squared away and avoid chasing your tail trying to get such as simple task completed.


Prerequisites


Add Groovy Framework to Existing Project

  1. Right-Click on Project Root Folder or if a Config Wizard Pops up at the top of your windows we can click that link.
  2. Select Add Project Framework Support
  3. Scroll down and select Groovy
    1. If it does not show in the list; it's because it already has the framework added.
    Jetbrains intellij idea add groovy framework to project01
    OR
    Jetbrains intellij idea add groovy framework to project02
  4. If Groovy has not been added to IntellJ then Select Create...
    Jetbrains intellij idea add groovy framework to project03
  5. Browse or Enter Path to Groovy home path. If SDKMan was used to install Groovy the path should be simular to this:
    Jetbrains intellij idea add groovy framework to project04
    /Users/username/.sdkman/candidates/groovy/current
    
    1. You can type this from terminal to help find the path
      which groovy
      
  6. Optionally Select Configure and set Groovy to Global Library for future projects
    Jetbrains intellij idea add groovy framework to project05
    Jetbrains intellij idea add groovy framework to project06
  7. Select OK
  8. Open Project Structure to double check or view currently configured Global Libraries/SDK/Framework (It's confusing they have so many terms for it and it's not simply under the SDKs)
    Jetbrains intellij idea add groovy framework to project07


Related Articles