Logo

dev-resources.site

for different kinds of informations.

Setting up Ballerina in IntelliJ IDEA

Published at
11/14/2017
Categories
ballerina
ballerinalang
intellijidea
Author
shan1024
Categories
3 categories in total
ballerina
open
ballerinalang
open
intellijidea
open
Author
8 person written this
shan1024
open
Setting up Ballerina in IntelliJ IDEA

Ballerina 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. If you want to learn more about Ballerina Language, you can refer this 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
3) Type “ballerina” in the search box. Ballerina plugin will be shown as below. Click on the Install button.
Browse Repositories
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 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
3) Now we have to setup a Ballerina SDK in the next window. Click on Configure button.
Project Wizard
4) Then select the unzipped runtime directory and select OK.
SDK Home selection
5) If you followed the steps correctly, the Ballerina runtime should be added as a SDK successfully. Now select Next.
Project Wizard
6) Now update the Project name and Project location and select Finish.
Project Wizard
7) Ballerina project will be created and opened like shown below.
Ballerina Project

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
3) Now you will have a new Ballerina program file with a main function.
New File
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
Click on the run icon and select the run command.
Run File
5) You will see the output in the Run window.
Run Window

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 to see various examples written in Ballerina. Also if you have questions, suggestions, etc, you can -

ballerina Article's
24 articles in total
Favicon
Getting Started with Ballerina: A Beginner’s Guide
Favicon
Harnessing the Power of Ballerina for Data Streaming Applications
Favicon
Ballerina vs. Node.js: Choosing the Right Language for Your Next Project
Favicon
Building a REST API with Ballerina: A Beginner’s Walkthrough
Favicon
Why Ballerina Should Be on Every Developer's Radar in 2024
Favicon
Microservices Made Simple with Ballerina: The Future of Distributed Systems
Favicon
GraphQL Federation with Ballerina and Apollo - Part II
Favicon
GraphQL Federation with Ballerina and Apollo - Part I
Favicon
Integration thought iteration-The not Bad, the OK, and the Good Enough
Favicon
Ballerina Identifiers: A Simple Guide for New Developers
Favicon
Simplify Ballerina Workflow on GitHub with setup-ballerina Action
Favicon
Getting Started Programming Ballerina 101
Favicon
How Ballerina Lang can Improve their Developer Experience & Adoption
Favicon
Giving Ballerina Lang a Twirl
Favicon
Production-grade Ballerina Microservices on Azure AKS - Part 2: Continuous Integration With Azure DevOps
Favicon
Production-grade Microservices on Azure AKS with Ballerina — Part 1: The Basics
Favicon
Redux in Ballerina programming language 🎉🎉🎉
Favicon
Unveiling Ballerina Non-Blocking Architecture
Favicon
Defaultable Parameters in Ballerina
Favicon
Ballerina Interop and all you need to know
Favicon
How I added Ballerina support to GitHub
Favicon
Code to Kubernetes
Favicon
KubeCon 2018 - What's the developer story now?
Favicon
Setting up Ballerina in IntelliJ IDEA

Featured ones: