How Do You Run a Groovy Program on a Debian or Ubuntu Server?

Problem scenario
You want to use a Java Virtual Machine language on an Ubuntu Linux server.  You want to test out the language too.  What should you do?

Prerequisites
Install Groovy version 1; this command should work:  sudo apt-get -y update; sudo apt-get -y install groovy

Procedures
1.  Create a file called hello.groovy with the following five lines:

class Example {
   static void main(String[] args) {
      println('Hello World');
   }
}

2.  Run it like this:  groovy hello.groovy

Leave a comment

Your email address will not be published. Required fields are marked *