Groovy/BBEdit Follow-up

Well, I posted perhaps a moment too soon. Using BBEdit as a scratchpad isn’t going to be quite so tidy, since groovy cares deeply about the name of the file which contains the script. I had noticed this earlier when I named my version of “Hello World” as ‘hello-world.groovy’: when I ran it I got an error because ‘hello-world’ is not a legal Java identifier. Renaming it to “helloWorld.groovy” was all it took. But then when I pasted in some regular expression code into the file and tried running it without saving it, I got something like this:

/opt/groovy/bin/groovy: line 45: [: too many arguments
Exception in thread "main" java.lang.ClassFormatError: 2532143
   (Illegal Class name "2532143")

Just saving the file was all it took, but little things like that make it less suitable for a scratchpad. Oh well. I’ve been meaning to give Eclipse another shot anyway.

One thought on “Groovy/BBEdit Follow-up

  1. If you make sure your file has unix line ends and you (once) hold down the command key and choose “Run…” from the #! menu and turn on auto save before running, BBEdit shouldn’t need to create temp files to run your script.

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>