Question

I use Eclipse and Erlide to develop in Erlang. To run the software I enter the ebin/ directory with my terminal since I don't like the console Eclipse provides. However after each change I have to exit and re-enter erl in the terminal to reload the .beam files that have been changed. Eclipse automatically generates new .beam files into the ebin/ directory after every save.

I know I can manually compile it with the c(filename) command, but that would require me to move to the src/ directory, compile the files, and move them back to the ebin/ directory. This requires a lot more work that just exiting and entering the Erlang terminal. I have heard of makefiles, but I don't know if they can be ran from within an Erlang terminal. The reason I don't want to exit the terminal is because I will lose my history of previous commands. If I'm using modules:methods with long names this takes a lot of typing time for each change made.

Is there any method to reload the .beam files in the current directory while in an Erlang terminal? Or is there any way to load the previous command history of the Erlang terminal?

Was it helpful?

Solution 2

I would suggest something like active or sync but straightforward approach with c/1, l/1 and nl/1 works too

OTHER TIPS

You can use the l(Module). command in the shell which loads, or reloads, a module from the current directory into Erlang.

[edited] Run your application from eclipse and check the node name, the default is @. Shut that down.

Start a separate erlang node with the same name. Now when running the application from eclipse that node will get used and you can use the shell in the terminal, while erlide will be able to reload beam code automatically when saving files.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top