Initial Configuration
Install and enable the plugin
In the Settings/Preferences dialog Ctrl+Alt+S, select the Plugins section on the left.
Switch to the Marketplace tab at the top and search for a plugin called Erlang.
Once the plugin is found, click Install, apply the changes, and close the dialog. Restart the IDE if prompted.
Install Erlang/OTP framework
Erlang/OTP is a set of Erlang libraries and design principles essential for development.
To install Erlang/OTP, follow the instructions below that correspond to your OS:
Download the Erlang/OTP package and run the installation wizard. Take a note of the installation folder path.
Once the installation is over, add the <installation folder>\bin path to the PATH environment variable:
To verify that Erlang/OTP is installed correctly, do either of the following:
Type
"erl"
in the command prompt to start up the Erlang shell:Run the Erlang Emulator (<installation folder>\bin\werl.exe). This will start Erlang in its own window, with fully functioning command-line editing and scrollbars.
Run the following command in the terminal:
To verify that Erlang/OTP is installed correctly, start up the Erlang shell from the terminal using the
erl
command:For Ubuntu/Debian:
sudo apt-get update sudo apt-get install erlangFor Fedora:
sudo yum install erlangFor FreeBSD:
sudo pkg update sudo pkg install erlang
To verify that Erlang/OTP is installed correctly, start up the Erlang shell from the terminal using the
erl
command:
Install and configure Rebar
In addition to Erlang/OTP, you will also need Rebar3: a build tool that helps compile and test Erlang applications. It is the spiritual successor to rebar (v2.x), which is now deprecated.
Rebar3 comes in the form of a portable executable escript file which can be used either as is (script version) or as a means to install a faster, fully compiled form of Rebar3.
The process of installing Rebar3 from source, as well as other ways to install and run it are described at length in the tool's official documentation.
The latest stable release of the escript can be downloaded in one of the two ways:
Directly from the official Rebar3 website.
From IntelliJ IDEA:
Ctrl+Alt+S
Click 'Download the latest Rebar 3'
Select the directory where you want the downloaded escript to be saved.
Specifying the path to the Rebar3 executable in the Rebar run/debug configurations and execute existing ones:
dialog will allow you to create newConfigure the IDE to work with Erlang SDK
The last step of the initial configuration is to let IntelliJ IDEA know where the Erlang SDK is located on your computer.
Once your project is opened, go to the
dialog Ctrl+Alt+Shift+SIn the
section, click to add a new SDK, then selectIn the file chooser dialog that appears, select the directory where you installed Erlang/OTP, for example C:\Program Files (x86)\erl23.3.
The SDK will be detected and displayed on the list of available SDKs, its lib folder automatically added to the classpath.
If you don’t know where Erlang OTP was installed, check the following directories:
OS
Path
Windows
C:\Program Files (x86)\erl<version>
Linux
/usr/lib/erlang/<version>
MacPorts, macOS
/opt/local/lib/erlang/<version>
Homebrew, macOS
/usr/local/Cellar/erlang/<version>