Hello there, today we will be using groovyConsole for writing groovy scripts very easy to use Graphical User Interface. Yes, groovyConsole is a GUI program, like an editor where you can write Groovy scripts and execute them to vie the output.
For using the groovyConsole, you will need to have the Groovy and SDKMan installed in your machine. Hence, if you havent got this installed in your system, you can install it by following our articles on Installing Groovy in Ubuntu and Installing SDKMan in Ubuntu.
Once you have these prerequisites installed, you can just execute the following command in the shell terminal to open up the Groovy editor:
groovyConsole
Executing this command will open up the Groovy console window similar to screen shown below:
You can type in the Groovy scripts in the upper pane and view the output in the lower pane. To run the Groovy script that you have written, you will need to press Ctrl + R.