Maths noob
Maths noob

Reputation: 1802

Configuring Erlang plugin for Intellij

I am trying to set-up an Erlang project in IntelliJ 15. I am running windows.

I have built Rebar. trying escript.exe "//rebar_path//" --version returns the version number. Erlang also works on command line. In Settings->Other-settings->Erlang External tools I have the address of rebar file and IntelliJ detects the version number alright.

For my hello-world Erlang App, I have added an Erlang console application which runs fine and gives me

D:/Program Files/erl7.2.1\bin\erl" -pa E:/Documents/Projects/Erlang_test/out/production/Erlang_test -pa E:/Documents/Projects/Erlang_test

at the top. However attempting to call the functions gives me:

exception error: undefined function hello:hello2/0

It's as if compilation does not happen. I also tried setting up an "Erlang Rebar" Run configuration with compile as the command. It outputs:

*"D:\Program Files\erl7.2.1\bin\escript.exe"
E:\Documents\Projects\rebar_source\rebar c*

at the top, followed by the error:

escript: Error executing 'D:\Program': 193

What am I doing wrong?

update: I tried adding the rebar.cmd as an external tool to run it before the run configuration. After doing some research, I tried adding a rebar.config file with:

{sub_dirs, ["src" ] }.

to match the project structure.

Running the tool with compile on its own outputs: (configuration page screenshot)

==>src (compile)
==> Erlang_test (compile)

I was expecting to get: Compiled src/hello.erl but I neither get that, nor do I see any bean files created anywhere; and if I try running hello:hello() in the "Erlang console" run configuration gives me:

exception error: undefined function hello:hello2/0

Upvotes: 1

Views: 1662

Answers (0)

Related Questions