Erlang says Hello World!

Erlang learning (2) - installation and erlide

Posted by Bing Yan on December 18, 2018

Preface

    In the last study, I had a preliminary understanding of erlang. At the beginning of this study, let us install the erlang environment, install the erlang development plugin, and run the first erlang program - Hello World!
    For a new language, it is important to master the correct learning method and do more with less. This learning method includes: check the official Guide document and learn by doing.

Text

Erlang Installation

  • Find the official website of Erlang and download the latest installation package.

  • Install Erlang by running .exe file -> select components -> Next -> Installation Complete.
    During installation, there is prompt about Microsoft Visual C++,Redistributable package, I selected ‘Repair’.

  • Configure environment variables. Similar as other env configuration - add Erlang bin path in env ‘Path’.
    Run ‘erl’ in cmd, confirm installation and env configuration are correct.

Erlide Installation

Erlide is an IDE for Erlang, powered by Eclipse.
Erlide official website

Find link of Erlide Installing and updating.
My Eclipse is Release 4.7.0 (Oxygen), later than required version 4.6. The Erlide installation is OK.
After Erlide installation, Eclipse can new Erlang project.

First Erlang Project

According to programming conventions, the first project of Erlang also outputs ‘Hello World’.

  • New project: File -> New -> Project -> Erlang -> Erlang Project -> Name: first_erlang_project

  • New module: Right click on src of first_erlang_project -> new module -> Module name: tut

  • Edit tut.erl file as below:


  • Right click on first_erlang_project -> run as -> run configurations
    Right click on Erlang application on the left -> new
    Select first_erlang_project on main page on the right.


Select runtimes page -> run


  • In Console, input ‘test:say()’


Summary

    Erlang’s runtime and development environment is installed, and I can start learning Erlang while doing it.
    Hello World will write, I feel that I have succeeded a big step.

Reference

http://www.erlang.org
https://erlide.org/articles/eclipse/index.html
https://erlide.org/articles/eclipse/120_Installing-and-updating.html
https://weiqingfei.iteye.com/blog/264684
https://www.cnblogs.com/minily/p/7398445.html