Message-ID: <1705196355.1157.1410961021390.JavaMail.firstname.lastname@example.org> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_1156_996221081.1410961021390" ------=_Part_1156_996221081.1410961021390 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
There are various options for compiling Groovy code and then eit= her running it or using the Java objects it creates in Java code.=20
There is an Ant task called groovyc which works pretty =
similarly to the javac Ant task which takes a bunch of gro=
ovy source files and compiles them into Java bytecode. Each groovy class th=
en just becomes a normal Java class you can use inside your Java code if yo=
Indeed the generated Java class is indistinguishable from a n= ormal Java class, other than it implements the
There is also an excellent artic=
le on DeveloperWorks
which will show you how to compile Groovy co= de from within Maven, similarly to what is done with Ant.
If you don't want to explicitly compile groovy code to bytecode you can = just embed groovy directly= into your Java application.=20
As well as Java 1.4, or above, and the Groovy jar we also depend at runt= ime on the ASM library (asm and asm-tree mainly), as well as Antlr. You can= also use the groovy-all-xxx.jar from your GROOVY_HOME/embeddable directory= , which embeds ASM and Antlr in its own namespace, to avoid Jar version hel= l.