I unsuccessfully attempted to install Groovy 1.8.6 (zip distribution) on a Win XP (sp3) machine yesterday and today (the error messages stated it was unable to find the groovyStarter then I received a lengthy stack trace…). Needless to say, it was a frustrating experience. So, I decided to use the Windows installer for version 1.8.5. Groovysh functions as it should but if I write a small Groovy script and place it in a file:
println "Hello Groovy Programmer!"
…no output is displayed. Using groovy -e “println ‘Hello!'” has the exact same behavior.
Any ideas of what might cause this?
Thanks.
~Caitlin
I’m not sure what you mean by “installing” the binary ZIP distribution. You don’t really install anything in the usual sense of the term… you just unzip the ZIP file wherever you like. On my Windows XP laptop, I unzipped its contents into
C:\groovy-1.8.6\.I have heard some people complain of problems when they unzip into a path that contains spaces (such as
C:\Documents and Settings\YourUsername\Desktop)… so perhaps that could be your issue, if you unzipped to your Desktop or something.Just unzip the ZIP file somewhere, and add it’s
/bindirectory to your PATH. On a Windows XP machine:PATHvariable, and addC:\groovy-1.8.6\bin(or whatever)The Groovy installation instructions also suggest that you add a
GROOVY_HOMEvariable (pointing toC:\groovy-1.8.6), and aJAVA_HOMEvariable pointing to the root directory of your Java JDK (not the JRE located inside of the JDK). However, to be honest, I only remember to add these two environment variables half the time when putting Groovy on a a new machine, and it’s never caused me problems.With the ZIP file unzipped, and its
/bindirectory in yourPATH, you just open a command-prompt and type:… or, to run the GUI interface:
If by chance you saw those “groovyStarter” errors because you tried to run
startGroovy, then use one of the two commands above instead. The “startGroovy.bat” command is an internal script intended for indirect use through the other scripts under/bin. It will throw ajava.lang.ClassNotFoundException: org.codehaus.groovy.tools.GroovyStarterstacktrace if you call it directly… because it needs one of the other scripts to set some variable prior to calling it.Good luck!