I’m finally getting around to poking at Groovy, a new scripting language which builds on Java… well, let them say it:
Groovy is a new agile dynamic language for the JVM combining lots of great features from languages like Python, Ruby and Smalltalk and making them available to the Java developers using a Java-like syntax.
Groovy is designed to help you get things done on the Java platform in a quicker, more concise and fun way – bringing the power of Python and Ruby inside the Java platform.
Groovy can be used as an alternative compiler to javac to generate standard Java bytecode to be used by any Java project or it can be used dynamically as an alternative language such as for scripting Java objects, templating or writing unit test cases.
Anyway, they have a shell (“groovysh”) which looks a little like the Python interactive interpreter, but which isn’t really so interactive. So, while I’m trying to learn my way around groovy syntax, I’d like some slightly more flexible way to edit and run the code. Meanwhile, I’ve been using BBEdit’s ability to run perl and other UNIX scripts a ton lately, and really liking it, so I just went ahead and tried to run the basic Groovy “Hello World” in BBEdit. Whoops: “JAVA_HOME is not defined.” Apparently Cocoa apps don’t see the UNIX environment.
Good ol’ Google:
How to define environment variables so that MacOS X applications can see them. Now running a groovy script by typing it in BBEdit and choosing ‘run’ from the “#!” menu works like a charm.
How to define environment variables so that MacOS X applications can see them. Now running a groovy script by typing it in BBEdit and choosing ‘run’ from the “#!” menu works like a charm.
Now to Groovy syntax. Warning: it looks as though the link from the Groovy front page to “Core Syntax” is more like a wish-list/to-do list than a reference.
Pingback: Through The Wire