The Linux Foundation Projects
Skip to main content
Blog | Galasa

Galasa: Preparing to get started with the Galasa CLI on my Mac

By | March 11, 2024March 15th, 2024

 

Written by Caroline McNamara, Content developer at IBM and Galasa Contributor

Find out how I got the pre-requisite software installed on my machine – the commands I used, the software versions I installed, and how I set up my environment variables so that I could start using the Galasa command line tool on my Mac.

What software did I need to install?

I wanted to start running the Galasa-provided tests locally on my Mac using the Galasa command line tool (galasactl). I planned to use Maven and Gradle for creating my Galasa projects, so I installed the following open-source software versions:

  • Java JDK version 11(Galasa requires Java version 11 JDK or later. Galasa does not support Java 17 or later)
  • Maven version 9.5 (The latest Maven release at the time of writing)
  • Gradle version 6 (All Galasa versions are compatible with Gradle 6.9.x)
  • Rancher Desktop for macOS aarch64 (rather than Docker)
  • The latest version of the Galasa command line tool

Installing the software

I had Homebrew installed on my machine already, so I used that to install Java JDK, Maven, and Gradle. You can install Homebrew from the Homebrew website.

Installing Java JDK

To check if I had Java JDK installed on my machine, I ran the following command  in my terminal:java -version.
I didn’t , so I installed Java JDK version 11 by running the command brew install openjdk@11 and then checked it installed successfully by running  /opt/homebrew/opt/openjdk@11/libexec/openjdk.jdk/Contents/Home/bin/java –version.I got the following successful response in the terminal:

openjdk 11.0.20.1 2023-08-24

OpenJDK Runtime Environment Homebrew (build 11.0.20.1+0)

OpenJDK 64-Bit Server VM Homebrew (build 11.0.20.1+0, mixed mode)

Installing Maven

I used Homebrew to install the latest Maven version by running the command brew install maven. To check that  Maven was installed correctly, I ran the command  mvn -v and got the following successful response: 

Apache Maven 3.9.5 (57804ffe001d7215b5e7bcb531cf83df38f93546)

Maven home: /opt/homebrew/Cellar/maven/3.9.5/libexec

Installing Gradle

I used Homebrew to install Gradle version 6 by running the command brew install gradle@6 . To check that Gradle was installed correctly, I ran the command  gradle -v and got the following successful response:

————————————————————

Gradle 6.9.4

————————————————————

Build time:   2023-02-22 08:43:12 UTC

Revision:     7f4120f27d6dc6a1gh6dfc466b834b0403j0b0c4

Kotlin:       1.4.20

Groovy:       2.5.12

Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020

JVM:          11.0.20.1 (Homebrew 11.0.20.1+0)

OS:           Mac OS X 14.0 aarch64

Installing Rancher

I installed Rancher Desktop for macOS aarch64 by following the instructions from the Rancher GitHub Release page.

Installing the Galasa command line tool (galasactl)

As recommended in the Galasa documentation, I created a folder called `tools` in my home directory and followed the instructions from the [Installing the Galasa CLI](https://galasa.dev/docs/cli-command-reference/installing-cli-tool) page in the Galasa website to install the galasactl executable on my machine.

I tested it by running the command galasactl --help .

Adding the software to my PATH

macOS uses the zsh (Z Shell) by default, which means that configuration for required shell settings is stored either in .zprofile or .zshrc. Whether one or both is used might depend on your configuration. Many Mac users use .zshrc, but you might want to check your personal configuration and use the configuration file that best suits your machine’s working environment.

I used .zshrc, so ensured that each of the paths for Maven (/opt/homebrew/bin), Gradle (/opt/homebrew/opt/gradle@6/bin), and the tools folder where I downloaded the galasactl tool (in my case `$HOME/tools`) were added to my PATH in my .zshrc file.

Setting JAVA_HOME  

To set my JAVA_HOME environment variable I added the following line to my .zshrc file:

export JAVA_HOME="/opt/homebrew/Cellar/openjdk@11/11.0.20.1/libexec/openjdk.jdk/Contents/Home

I checked the variable was set by running the command echo $JAVA_HOME and got the response:

/opt/homebrew/opt/openjdk@11/libexec/openjdk.jdk/Contents/Home/bin/java

Next steps

I now had all the software that I needed installed and configured on my machine to get started with the Galasa CLI, and was ready to initialize my local environment, explore Galasa Simbank, and run the provided Simbank tests by following the instructions in the Galasa website.