Problem scenario
You want to use a Java Virtual Machine language on a CentOS/RHEL/Fedora server. You want to test out the language too. What should you do?
Prerequisites
Install Groovy; this command should work (assuming your server is configured to work with a yum repository with groovy): sudo yum -y install groovy
# If your yum repositories do not have Groovy, see this posting.
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