Setting up Ballerina in IntelliJ IDEA
Tags: ballerina, ballerinalang, intellijidea
Published: 2017-11-14 17:14:33

---
title: Setting up Ballerina in IntelliJ IDEA
published: true
description: 
tags: Ballerina, BallerinaLang, IntelliJ IDEA
---
[Ballerina](https://ballerinalang.org/) is a new open source programming language with textual and graphical syntaxes. From this article, I am focusing on providing a step by step guide for setting up a Ballerina project in [IntelliJ IDEA](https://www.jetbrains.com/idea/). If you want to learn more about Ballerina Language, you can refer [this](https://medium.com/ballerinalang/ballerina-making-sequence-diagrams-work-d0d7b3846a80) article.

## Installing Ballerina plugin

So the first thing we need to do is installing Ballerina plugin to IntelliJ IDEA. But please note that you must have IDEA version 2016.3 or above to use the plugin. This plugin supports both IDEA Community and Ultimate versions.

Steps to install Ballerina plugin -
1) Go to **File** (**Preferences** in **MacOS**) -> **Settings**.
2) Select **Plugins** section and click on **Browse repositories** button.
![Settings](https://thepracticaldev.s3.amazonaws.com/i/aab69ypxtakk9d4z330c.png)
3) Type “ballerina” in the search box. Ballerina plugin will be shown as below. Click on the Install button.
![Browse Repositories](https://thepracticaldev.s3.amazonaws.com/i/ac3w2pand2tl8yjcl7oq.png)
4) After installing the plugin successfully, you need to restart the IDEA.

## Downloading Ballerina runtime

To use Ballerina plugin to it’s full potential, you need to add the Ballerina Runtime as a SDK to the IDEA.
You can download the runtime distribution from the [BallerinaLang](https://ballerinalang.org/downloads/) website. Download the runtime distribution and unzip the file.

## Creating a new Ballerina project

1) Go to **File** -> **New** -> **Project**.
2) Select **Ballerina** project type and select **Next**.
![Project Wizard](https://thepracticaldev.s3.amazonaws.com/i/a74ketkjokqb37poxjkw.png)
3) Now we have to setup a Ballerina SDK in the next window. Click on **Configure** button.
![Project Wizard](https://thepracticaldev.s3.amazonaws.com/i/qn7wwjatdxjqrt3wr8im.png)
4) Then select the unzipped runtime directory and select **OK**.
![SDK Home selection](https://thepracticaldev.s3.amazonaws.com/i/lby5snrgwbwitzeabjxz.png)
5) If you followed the steps correctly, the Ballerina runtime should be added as a SDK successfully. Now select **Next**.
![Project Wizard](https://thepracticaldev.s3.amazonaws.com/i/suzmb1olewx1izvv8e4b.png)
6) Now update the Project name and Project location and select **Finish**.
![Project Wizard](https://thepracticaldev.s3.amazonaws.com/i/c9ftfvxchh99wc0r6k6z.png)
7) Ballerina project will be created and opened like shown below.
![Ballerina Project](https://thepracticaldev.s3.amazonaws.com/i/5oat0o3mwgtj8mxi5l3v.png)

## Creating a new Ballerina file

1) Go to **File** -> **New** -> **Ballerina File**.
2) Enter a file name and select the **Ballerina Main** kind. Ballerina Main kind will create a new file with a main function. There are few other kinds as well.
![New File](https://thepracticaldev.s3.amazonaws.com/i/thsk87wlpw5frfh4rs5p.png)
3) Now you will have a new Ballerina program file with a main function.
![New File](https://thepracticaldev.s3.amazonaws.com/i/1aqbti7xziyuifm4fziz.png)
4) Now you can use the run icon next to the main function to run the program. If you don’t add a Ballerina SDK, you wont be able to run Ballerina programs in the IDEA. That is why we configured a Ballerina SDK in the previous section.
![Run File](https://thepracticaldev.s3.amazonaws.com/i/1gkyrafipg652h8n7epl.png)
Click on the run icon and select the run command.
![Run File](https://thepracticaldev.s3.amazonaws.com/i/04dn9pd27636wtzsjrik.png)
5) You will see the output in the Run window.
![Run Window](https://thepracticaldev.s3.amazonaws.com/i/cdru60n1yx41fwgp9dig.png)

Congratulations, you have successfully configured Ballerina in IntelliJ IDEA and executed the Hello World program. Now you are ready for some serious action in Ballerina :)

## So where to next?
You can refer [Ballerina by Example](https://ballerinalang.org/docs/by-example/) to see various examples written in Ballerina. Also if you have questions, suggestions, etc, you can -
* Send them to [Ballerina dev](https://groups.google.com/forum/#!forum/ballerina-dev) Google group.
* Send them to [Ballerina Slack](https://ballerinalang.slack.com/messages/C47EAELR1/) channel.
* Open a [GitHub issue](https://github.com/ballerinalang/ballerina/issues).