Compile, Run, Debug
Last modified: 02 August 2022warning
The following is only valid when the Erlang plugin is installed and enabled.
Run Application
In order to run or debug your Erlang application in IntelliJ IDEA, you need do either of the following:
Click the Run icon in the editor's gutter next to the main function:
A temporary ad hoc run/debug configuration will be created on the fly in this case.
Open the Run | Edit Configurations dialog from the main menu and add an Erlang Application configuration manually (+). You'll need to specify the configuration's name, define the app's module and function, choose the corresponding IDE project module, fill out other optional fields, and hit OK in the end:
After the configuration is created, you will be able to:
Run your application from the main menu (Run | Run <configuration name>), navigation toolbar, or using a shortcut Shift+F10
Debug your application from the main menu (Run | Debug <configuration name>), navigation toolbar, or using a shortcut Shift+F9
Debug Application
warning
Debugger requires the Erlang Port Mapper Daemon (EPMD) to be up and running. To get it running, start a random Erlang node on your machine, for instance with the
erl -sname foo -s init stop -noshell
command.
In order to use the IntelliJ IDEA debugger with your Erlang application, you need to:
Make sure the 'Add debug info' option is enabled under Settings/Preferences Ctrl+Alt+S | Compiler | Erlang Compiler
Have an Erlang Application run configuration added to your project.
It can then be used to debug Shift+F9 your program:
Run and Build with Rebar
rebar3
commands represent tasks that can be run by the Rebar3 tool.
In IntelliJ IDEA, you can create an Erlang Rebar run configuration for every supported command or a batch of commands:

If you want to build your project using the rebar3 compile
command rather than the Build | Build Project default IntelliJ IDEA action, make sure to enable the following option:
Settings/Preferences Ctrl+Alt+S | Build, Execution, Deployment | Compiler | Erlang Compiler |'Compile project with rebar'
note
Rebar3 needs to be installed and configured first. 'Configure rebar' button will take you to the corresponding configuration dialog.
Thanks for your feedback!