How to run a ballerina program from Composer?

319 Views Asked by At

I was trying to run a ballerina program from composer but I was unable to run it. There was the following error in the console.

ERROR: Unable to run program, ballerina runtime cannot be found.
Please set BALLERINA_HOME environment variable pointing to ballerina runtime 

How can we set the BALLERINA_HOME in this case?

2

There are 2 best solutions below

0
On BEST ANSWER

You need to set the BALLERINA_HOME before running the composer. Point the BALLERINA_HOME to Ballerina runtime home folder and start the composer.

e.g. :

export BALLERINA_HOME = /Users/home/maheeka/ballerina-0.8.1-SNAPSHOT
composer
0
On

We are changing this behavior and it will be available with this week's minor release of Ballerina.

With this change, You don't need to set this environment variable at all. We will figure out your ballerina installation directory.