1.安装Erlang编译依赖:
yum -y install gcc glibc-devel make ncurses-devel openssl-devel xmlto perl wget
2.下载Erlang:
Erlang包下载地址http://www.erlang.org/download/
$ wget http://www.erlang.org/download/otp_src_22.1.tar.gz
3.解压并安装
$ tar -xzvf otp_src_22.1.tar.gz $ cd otp_src_22.1 $ ./configure --prefix=/usr/local/erlang $ make && make install
4.github安装方法(推荐)
$ git clone https://github.com/erlang/otp.git $ cd otp $ ./otp_build autoconf $ ./configure --prifix=/usr/local/erlang $ make && make install
5.配置环境变量
将
/usr/local/erlang/bin添加到
/etc/profile文件中
$ vim /etc/profile export PATH=$JAVA_HOME/bin:/usr/local/erlang/bin:$PATH $ source /etc/profile
6.验证Erlang 安装成功
$ erl Erlang/OTP 23 [DEVELOPMENT] [erts-10.5.3] [source-9938ee2] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe] Eshell V10.5.3 (abort with ^G) 1>
出现上面内容,说明安装成功了。
6.执行并退出Erlang
$ erl Erlang/OTP 23 [DEVELOPMENT] [erts-10.5.3] [source-9938ee2] [64-bit] [smp:1:1] [ds:1:1:10] [async-threads:1] [hipe] Eshell V10.5.3 (abort with ^G) 1> io:format("Hello World!~n"). Hello World! ok 2> halt(). $
注意: halt().退出程序,“.”不要忘记了。程序中句点(.)表示结束。
您可以选择一种方式赞助本站