CLion 2021.1 Help

Run/Debug Configuration: Gradle

Run | Edit Configurations | Add New Configuration | Gradle

Common

When you edit a run configuration (but not a run configuration template), you can specify the following options:

Item

Description

Name

Specify a name for the run/debug configuration to quickly identify it when editing or running the configuration, for example, from the Run popup Alt+Shift+F10.

Allow parallel run

Select to allow running multiple instances of this run configuration in parallel.

By default, it is disabled, and when you start this configuration while another instance is still running, CLion suggests to stop the running instance and start another one. This is helpful when a run/debug configuration consumes a lot of resources and there is no good reason to run multiple instances.

Store as project file

Save the file with the run configuration settings to share it with other team members. The default location is .idea/runConfigurations. However, if you do not want to share the .idea directory, you can save the configuration to any other directory within the project.

By default, it is disabled, and CLion stores run configuration settings in .idea/workspace.xml.

Configuration tab

ItemDescription
Gradle ProjectUse this field to specify the location of your Gradle project. You can either click Cl gradle prjicon and select from the list of the registered Gradle projects, or provide the path manually.
TasksUse this field to specify the list of tasks for your Run/Debug configuration. Use spaces to separate one task from another.
VM Options

Use this field to specify VM options for your Gradle project.

If you need more room to type, click Icons general expand component next to the field to access the VM options dialog where the text entry area is larger.

When specifying JVM options, follow these rules:

  • Use spaces to separate individual options, for example, -client -ea -Xmx1024m.

  • If an option includes spaces, enclose the spaces or the argument that contains spaces in double quotes, for example, some" "arg or "some arg".

  • If an option includes double quotes (as part of the argument), escape the double quotes using backslashes, for example, -Dmy.prop=\"quoted_value\".

ArgumentsSpecify Gradle command line parameters.
Environment variablesSet a list of environment variables used by your Grade project.

Logs tab

Use this tab to specify which log files generated while running or debugging should be displayed in the console, that is, on the dedicated tabs of the Run or Debug tool window.

ItemDescription
Is ActiveSelect checkboxes in this column to have the log entries displayed in the corresponding tabs in the Run tool window or Debug tool window.
Log File Entry

The read-only fields in this column list the log files to show. The list can contain:

  • Full paths to specific files.

  • Aliases to substitute for full paths or patterns. These aliases are also displayed in the headers of the tabs where the corresponding log files are shown.

    If a log entry pattern defines more than one file, the tab header shows the name of the file instead of the log entry alias.

Save console output to fileSelect this checkbox to save the console output to the specified location. Type the path manually, or click the browse button and point to the desired location in the dialog that opens.
Show console when a message is printed to standard output streamSelect this checkbox to activate the output console and bring it forward if an associated process writes to Standard.out.
Show console when a message is printed to standard error streamSelect this checkbox to activate the output console and bring it forward if an associated process writes to Standard.err.
the Add buttonClick this button to open the Edit Log Files Aliases dialog where you can select a new log entry and specify an alias for it.
the Edit buttonClick this button to edit the properties of the selected log file entry in the Edit Log Files Aliases dialog.
the Delete buttonClick this button to remove the selected log entry from the list.
the Browse buttonClick this button to edit the select log file entry. The button is available only when an entry is selected.
Last modified: 26 April 2021