Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

The groovy native launcher is a native program for launching groovy scripts. It compiles to an executable binary file, e.g. groovy.exe on windows.

To use the native launcher, you need to set the GROOVY_HOME environment variable. If you do not use -jh / --javahome option (see below), JAVA_HOME needs to be set also.

The native launcher accepts accepts the same parameters as the .bat / shell script launchers, and on top of that
-jh / --javahome <path to your jdk / jre> - makes groovy use the designated jre / jdk instead of the one pointed to by JAVA_HOME. Any jdk / jre >= 1.4 should work
--conf <conf file to use> use the given groovy conf file instead of the default one
-cp / -classpath / --classpath <user classpath> the classpath to use. Note that this does not need to be the first param as it must when using the windows groovy.bat

Any options not recognized as options to groovy are passed on to the jvm, so you can e.g. do

groovy -Xmx250m myscript.groovy

The -client (default) and -server options to designate the type of jvm to use are also supported, so you can do

groovy -Xmx250m -server myscript.groovy

Note that the environment variable JAVA_OPTS that the .bat/shell script launchers use is ignored.

The native launcher should support any platform and any jdk / jre. If you find something that is not supported, please post a JIRA enhancement request and support will be added.

At the moment, the following platforms have been tested:

  • Windows XP
  • linux (SuSE & Ubuntu) on x86
  • solaris on sparc

At the moment, the following jdks / jres have been tested

  • several versions of sun jre / jdk
  • jrockit

Compiling

The binaries are compiled w/ the provided rant script. Just type
rant

Usage

As the executable finds groovy's home dir using the env var GROOVY_HOME, it does not really matter where the executable is located. For consistency, it is best to locate it in ${GROOVY_HOME}/bin. Also, in the future the executable may assume that it is in that directory to find the necessary jars if GROOVY_HOME is not set.

Pre-compiled binaries

Precompiled binaries are unfortunately not yet available. Hopefully they will be soon.

  • No labels