6

I try compile erl files in Intellij with Erlang plugin. Everything is good with compilation but in out/production the folder does not create any files .beam and when I run console I get message:

exception error: undefined function. 

When I use c("file"). everything is all right. Why does Intellij not create .beam files?

2240
  • 1,547
  • 2
  • 12
  • 30
sebax
  • 59
  • 5
  • Do you compile with rebar? What is your project layout? – Lol4t0 Nov 06 '15 at 19:23
  • No, without rebar but my function are very simple like factorial. My friend use Intellij with Erlang plugin without any problems but I have.. I install Intellij and Erlang plugin, then I create new project with Erlang 18 SDK. I create new Erlang file in src folder. I should get beam file in production folder but I have nothing omitting "Compilation completed successfully" in log. When I write in Erlang console in Intellij cd(src). and c("file")., I create file beam and everything work.. – sebax Nov 06 '15 at 20:20
  • What do you mean `production` folder? Is it `production` or `ebin`? – Lol4t0 Nov 06 '15 at 21:41
  • When I clicked compile in my project's folder was created out/production and I think in this folder should was created beam file. – sebax Nov 06 '15 at 22:20
  • It depends on 'Project structure' paths actually. Check them. Also check if you setup sdk path correcly – Lol4t0 Nov 06 '15 at 22:25
  • Structure and sdk path is correctly.. It still doesn't work. – sebax Nov 08 '15 at 19:08

2 Answers2

3

Try to fix it by going to Preferences -> Build, Execution, Deployment -> Erlang Compiler and check "Compile project with rebar". Also, verify that rebar is installed and configured in IntelliJ by going to Preferences -> Other Settings -> Erlang External Tools and specifying the path to the rebar installation.

Igor Khvostenkov
  • 714
  • 5
  • 15
2

I was having the same issue ..

The problem is very strange erlang plugin doesn't compile and copy the files to out directories meanwhile if you compiled from terminal or command prompt (windows) it is working fine. this issue arose after installing IntelliJ Idea v 15.

What I have done here to fix the issue:

  • Uninstall Intellij Idea v 15
  • Downgrade IntelliJ Idead to version 14.1.4
  • Install Intellij Idea again (v. 0.5.11)
  • Configure SDK to reference src of erlang language.
  • Create a new test project and start making the project again .. it should work fine...

Hope this helps you

Muhammad Soliman
  • 21,644
  • 6
  • 109
  • 75