IntelliJ IDEA 2016.3 Help

Launching Groovy Interactive Console

IntelliJ IDEA lets you launch an interactive Groovy console in any project. You can use the console as a temporary file to write and evaluate your code. If dependencies in your project contain a Groovy library then the specified Groovy library is used to launch the Groovy console. If the dependencies do not contain a Groovy library then the bundled Groovy library of the Groovy version 2.3.9 will be used.

In this section:

To launch Groovy console

  1. On the main menu, choose Tools | Groovy Console.
  2. If your project consists of two modules or more, choose the module to use the classpath of:
    /help/img/idea/2016.3/Groovy_Module_Console.png

    The Groovy console starts in a separate tab in the editor:

    /help/img/idea/2016.3/groovy_editor_console.png

To use Groovy interactive console

  1. Type code in the console after the prompt character, or just paste from a different file.

    Note that coding assistance is available, as you type (code completion and error highlighting):

    /help/img/idea/2016.3/groovyConsoleCodeAssistance.png
  2. Click /help/img/idea/2016.3/run.png, or press Ctrl+Enter to execute the entered code.
    /help/img/idea/2016.3/groovy_console_results.png
  3. View the results in the Run Tool Window for Groovy Console.
  4. Use up and down arrow keys to navigate through the results' history. Depth of the history is defined by the Console commands history size in the Editor settings.

See Also

Last modified: 7 December 2016