Linux安装Erlang配置开发环境

这边插一句,若是你们学Erlang,建议仍是到 Linux环境下,这样其实也是能学到很多知识,毕竟如今市面上主流的服务器都是Linux,因此若是你如今还只是会在Window下的这一套,那就来到Linux下学学吧。 html

搜索了不少资料都说到,若是库不全的话,编译安装的时候会报各类错误,因此咱们站在巨人的肩膀上。 shell

首先,打好库: 服务器

  1. sudo apt-get install build-essential    
  2. sudo apt-get install libncurses5-dev     
  3. sudo apt-get install libssl-dev  
  4. sudo apt-get install m4   
  5. sudo apt-get install unixodbc unixodbc-dev  
  6. sudo apt-get install freeglut3-dev libwxgtk2.8-dev    
  7. sudo apt-get install xsltproc    
  8. sudo apt-get install fop   
  9. sudo apt-get install tk8.5   
安装好上面到依赖以后,到官网下个源码包: http://www.erlang.org/download.html

对下到的包进行解压并编译安装: 测试

  1. tar zxvf /home/lqg/下载/otp_src_R15B01.tar.gz  
  2. cd /home/lqg/otp_src_R15B01/  
  3. ./configure  
  4. make && make install  

这里编译通常不会出什么错误,可能会有的是jdk环境的问题:No Java compiler found
这是你检查下jdk 的环境就行了。 ui

最后,在终端输入 erl  es5

能够进行erlang的shell测试了: spa

  1. 1> io:format("hello wlord").  
  2. hello wlordok  
  3. 2> io:format("hello wlord ~n").  
  4. hello wlord   
  5. ok  
  6. 3> io:format("the output is: ~w ~w~n",[hello,world]).  
  7. the output is: hello world  
  8. ok  
  9. 4> io:format("the output is: ~w~w~n",[hello,world]).   
  10. the output is: helloworld  
  11. ok  
  12. 5> io:format("the output is: ~w~w~n",[hello,world]).  
  13. the output is: helloworld  
  14. ok 
相关文章
相关标签/搜索