Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
$ for f in `ls lib/groovy*.jar | cut -d/ -f2`;do k=`basename $f .jar`; mv lib/$k.jar lib/$k.jar.old; cp indy/$k-indy.jar lib/$k.jar ; done

Running groovy script from command line

The usual way to run a script from the command line is by "groovy foo.groovy", where foo.groovy is the groovy program in source form. To use indy for this you have to use the indy distribution and "groovy --indy foo.groovy". Doing this without the indy distribution will result in an error message.

The compilation flag

Independently of the jar version that you use (and after having exchanged the jars as described), invokedynamic support requires a specific compilation flag (indy). If you want to compile your classes with invokedynamic support, this flag must be set at compile time. The following tables show you what happens with user compiled classes and groovy core classes depending on the jar you use and the compilation flag:

...