• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            Fork me on GitHub
            隨筆 - 215  文章 - 13  trackbacks - 0
            <2017年1月>
            25262728293031
            1234567
            891011121314
            15161718192021
            22232425262728
            2930311234


            專注即時(shí)通訊及網(wǎng)游服務(wù)端編程
            ------------------------------------
            Openresty 官方模塊
            Openresty 標(biāo)準(zhǔn)模塊(Opm)
            Openresty 三方模塊
            ------------------------------------
            本博收藏大部分文章為轉(zhuǎn)載,并在文章開頭給出了原文出處,如有再轉(zhuǎn),敬請(qǐng)保留相關(guān)信息,這是大家對(duì)原創(chuàng)作者勞動(dòng)成果的自覺尊重!!如為您帶來不便,請(qǐng)于本博下留言,謝謝配合。

            常用鏈接

            留言簿(1)

            隨筆分類

            隨筆檔案

            相冊(cè)

            Awesome

            Blog

            Book

            GitHub

            Link

            搜索

            •  

            積分與排名

            • 積分 - 215415
            • 排名 - 118

            最新評(píng)論

            閱讀排行榜

            https://www.jetbrains.com/help/idea/getting-started-with-erlang.html

            Getting Started with Erlang

            Erlang is a great language that lets you build highly concurrent applications. This tutorial will teach you how to quickly get started with it.

            In this section:

            Preliminary steps

            Installing Erlang OTP

            The first thing for setting up an Erlang environment is installing Erlang OTP, a set of Erlang libraries essential for development.

            Windows

            If you are a Windows user, download the Erlang OTP package and run the installation wizard. Once the installation is over, add the installation path plus \bin to the PATH environment variable.

            macOS

            If you are an macOS user, to install Erlang OTP, type the following at the Terminal prompt (make sure you have Homebrew installed on your machine):

            brew install erlang

            If you prefer MacPorts to Homebrew, your command line should be different:

            port install erlang +ssl

            Linux

            The installation process for Linux is similar to macOS, except that instead of brew or port you have to use apt-get (a Linux package management utility):

            apt-get install erlang

            Verifying Erlang OTP installation

            To verify that Erlang OTP is installed correctly, run the Erlang shell by typing erl in a Terminal prompt:

            erlang otp

            To learn more about the Erlang shell, read its user guide.

            Installing Rebar

            In addition to Erlang OTP, you’ll also need Rebar, a build tool that helps compile and test Erlang applications. The easiest way to install it on your machine is to download its sources and build it locally:

            git clone git://github.com/rebar/rebar.git $ cd rebar $ ./bootstrap Recompile: src/getopt ... Recompile: src/rebar_utils ==> rebar (compile)

            Congratulations! You now have a self-contained script called "rebar" in your current working directory. Place this script anywhere in your path and you can use rebar to build OTP-compliant apps.

            Setting up IntelliJ IDEA

            Now when Erlang OTP and Rebar are set up, it’s time to download and install IntelliJ IDEA. Keep in mind, that for Erlang development you can use IntelliJ IDEA Community Edition (which is free and open-source).

            Once the IDE is up and you see its Welcome screen, go to Configure | Plugins, then click Browse repositories, locate the Erlang plugin and install it:

            erlang plugin

            After installing the plugin, restart IntelliJ IDEA.

            Configuring an Erlang SDK

            One more thing you’ll have to do to configure IntelliJ IDEA is to add an Erlang SDK.

            To do that, change the structure of the default project. Open the default project structure in one of the two ways:

            • On the Welcome screen, go to Configure | Project Defaults | Project Structure
            • On the main menu, choose File | Other Settings | Default Project Structure

            Then, add an Erlang SDK by specifying the path to the Erlang OTP installation directory.

            erlang sdk

            If you don’t know where Erlang OTP was installed, check the following directories:

            • WindowsC:\Program Files\erl<version>
            • Linux/usr/lib/erlang/<version>
            • MacPorts, macOS/opt/local/lib/erlang/<version>
            • Homebrew, macOS/usr/local/Cellar/erlang/<version>

            Configuring Rebar

            The final adjustment you have to do is to specify the path to Rebar, so that IntelliJ IDEA can run Rebar commands from the IDE.

            You can do it via Configure | Preferences | Other Settings → Erlang External Tools:

            erlang rebar configure

            Creating a new project

            Creating an Erlang project

            There are several ways to create a new Erlang project. The easiest one is to use the New Project Wizard from the Welcome screen.

            Click Create New Project:

            erlang create new project

            Then choose Erlang in the left pane, and click Next.

            erlang create new project erlang

            IntelliJ IDEA prompts you to choose an Erlang SDK (which you've already configured):

            erlang create new project sdk

            After that you’ll be asked to specify the name of your project and its directory. The following image shows the resulting Erlang project with the name ErlangDemo:

            erlang project

            Creating a Rebar project

            Instead of a pure Erlang project, you might want to create a Rebar project. To do that, type the following code at the Terminal prompt:

            rebar create-app appid=<project name>

            Once the project has been created, import it into IntelliJ IDEA to make it possible to open this project in the IDE.

            Importing a project into IntelliJ IDEA

            You can import a project into IntelliJ IDEA in several ways. Let's explore importing from the Welcome screen.

            To import an existing project into IntelliJ IDEA, click Import on the Welcome Screen, and choose the project directory. IntelliJ IDEA offers you to either import the project from existing sources, or from an external model (a build file).

            If your project uses Rebar, select the corresponding option when asked.

            erlang import project

            When importing a Rebar project, make sure to enable the option Fetch dependencies with rebar:

            erlang import project fetch

            Running and debugging an application

            To run an application, you have to create a run/debug configuration created against the stub Erlang Application. To do this, on the main menu choose Run | Edit Configurations, select the stub Erlang Application, specify the name (here it is hello.hello_world), and specify the application’s module and function:

            erlang run config

            After that you’ll be able to run your application via the main menu (Run | Run <run configuration name>, the toolbar (run), or a even a shortcut (Ctrl+Shift+F10).

            Once you have a run/debug configuration, you can also debug your application via the main menu (Run | Debug ‘<run configuration name>, the toolbar (debug), or a shortcut (Shift+F9):

            erlang debug

            For more information, refer to the concept of a run/debug configuration and the procedural sections Running Applications and Debugging.

            Running Eunit tests

            Running Eunit tests is similar to running an application, but needs a different run/debug configuration, created against the stub Erlang Eunit:

            erlang eunit config

            IntelliJ IDEA provides a handy Test Runner with support for Eunit. It shows test results, lets you rerun tests of you choice, jump to failed tests, etc.:

            erlang test

            Running Rebar commands

            Running Rebar commands is also possible right from the IDE – with the help of the Erlang Rebar run/debug configuration:

            erlang rebar run config

            Note that if your Rebar commands run tests, you can use a Erlang Rebar Eunit run/debug configuration to see test results in a Test Runner.

            Additional

            Learning Erlang

            To learn Erlang, we recommend that you start by reading the official Erlang user guide, and of course the Learn You Some Erlang for Great Good tutorial by Fred Hebert.

            Learning IntelliJ IDEA

            IntelliJ IDEA is a Java IDE in the first place, however it’s also a platform and IDE for other languages, such as Erlang, Python, Ruby, PHP, and many other. To learn more about IntelliJ IDEA, it’s worth checking out the section Discover IntelliJ IDEA and watch the Video Tutorials.

            If you have a question, you can always ask it on StackOverflow (probably it’s already answered).

            Providing Feedback

            In case you’d like to share your feedback about IntelliJ IDEA or its support for Erlang, feel free to submit an issue in Erlang plugin GitHub repository, or to the IntelliJ IDEA issue tracker.

            Refer to the section Reporting Issues and Sharing Your Feedback.

            posted on 2018-01-22 13:49 思月行云 閱讀(927) 評(píng)論(0)  編輯 收藏 引用 所屬分類: Erlang
            久久99精品久久久久子伦| 日韩欧美亚洲综合久久影院d3| 少妇久久久久久被弄到高潮 | 人妻无码久久精品| 久久国产成人| 色噜噜狠狠先锋影音久久| 国产99久久久久久免费看| 波多野结衣AV无码久久一区| 久久国产精品久久国产精品| 中文字幕日本人妻久久久免费| 久久久久久亚洲AV无码专区| 久久久久亚洲AV成人网人人网站| 国产精品综合久久第一页| 免费一级做a爰片久久毛片潮| 91精品无码久久久久久五月天| 国产精品禁18久久久夂久| AA级片免费看视频久久| 久久夜色精品国产亚洲| 久久亚洲国产精品成人AV秋霞| 久久精品无码午夜福利理论片 | 66精品综合久久久久久久| 欧美国产精品久久高清| 久久香蕉超碰97国产精品| 久久久一本精品99久久精品88| 国产成人香蕉久久久久| 久久久精品国产免大香伊| 91久久香蕉国产熟女线看| 亚洲愉拍99热成人精品热久久| 亚洲国产成人久久精品影视| 亚洲精品无码久久千人斩| 亚洲国产欧美国产综合久久| 国产叼嘿久久精品久久| 亚洲精品乱码久久久久久久久久久久 | 亚洲精品乱码久久久久久按摩| 久久精品免费大片国产大片| 理论片午午伦夜理片久久| 91精品国产91久久久久福利| 国产精久久一区二区三区| 久久久久免费看成人影片| 中文字幕无码av激情不卡久久| 亚洲精品乱码久久久久久自慰|