Sample-groovy-in-Z2 » History » Revision 6
Revision 5 (Udo Offermann, 08.04.2013 16:49) → Revision 6/29 (Udo Offermann, 08.04.2013 17:00)
h1. Sample Groovy in Z2 h2. Prerequisites All you need is a JDK 6 distribution as described in [[Step_2_-_Install_and_run_in_5_minutes]]. h2. Setting up the sample There is no further pre-requisite to running this sample, and you may proceed as described in [[How to run a sample]]. Here's the really fast version: <pre><code class="ruby"> mkdir install cd install git clone -b master http://git.z2-environment.net/z2-base.core git clone -b master http://git.z2-environment.net/z2-samples.groovy # on Linux / Mac OS: cd z2-base.core/run/bin ./gui.sh # on Windows: cd z2-base.core\run\bin gui.bat </code></pre> The first time you launch the sample will take a while. Watch the log output and keep an eye out for the following lines: <pre> 04/08 16:59:51 [32]...ent/webWorker@0.2 16:49:03 [31]...ent/webWorker@0.2 [800]: 04/08 16:59:51 16:49:03 [1]...pp.WebAppResource [800]: Starting WebApp: com.zfabrik.samples.groovy.web/web 04/08 16:59:51 [32]...ent/webWorker@0.2 16:49:04 [31]...ent/webWorker@0.2 [800]: 04/08 16:59:51 16:49:04 [1]...er.GroovyCompiler [800]: GROOVYC: Version 2.1.2 04/08 16:59:51 [32]...ent/webWorker@0.2 16:49:04 [31]...ent/webWorker@0.2 [800]: 04/08 16:59:51 16:49:04 [1]...er.GroovyCompiler [800]: GROOVYC: Compiling 'com.zfabrik.samples.groovy.web/java' using plain Groovy Compiler... Joint-Compiler... 04/08 16:59:52 [32]...ent/webWorker@0.2 16:49:05 [31]...ent/webWorker@0.2 [800]: 04/08 16:59:52 16:49:05 [1]...er.GroovyCompiler [800]: GROOVYC: 'com.zfabrik.samples.groovy.web/java' successfully compiled. 04/08 16:59:52 [32]...ent/webWorker@0.2 16:49:05 [31]...ent/webWorker@0.2 [800]: 04/08 16:59:52 16:49:05 [1]...er.GroovyCompiler [800]: GROOVYC: Total 613ms 1220ms 04/08 16:59:52 [32]...ent/webWorker@0.2 16:49:05 [31]...ent/webWorker@0.2 [800]: 04/08 16:59:52 16:49:05 [1]...pp.WebAppResource [800]: Done starting Web App (/plain-groovy-sample): (/groovy-sample): com.zfabrik.samples.groovy.web/web 04/08 16:59:52 [32]...ent/webWorker@0.2 [800]: 04/08 16:59:52 [1]...pp.WebAppResource [800]: Starting WebApp: com.zfabrik.admin/web 04/08 16:59:52 [32]...ent/webWorker@0.2 [800]: 04/08 16:59:52 [1]...pp.WebAppResource [800]: Done starting Web App (/adm): com.zfabrik.admin/web 04/08 16:59:52 [32]...ent/webWorker@0.2 [800]: 04/08 16:59:52 [1]...pp.WebAppResource [800]: Starting WebApp: com.zfabrik.samples.groovy_and_java.web/web 04/08 16:59:52 [32]...ent/webWorker@0.2 [800]: 04/08 16:59:52 [1]...er.GroovyCompiler [800]: GROOVYC: Version 2.1.2 04/08 16:59:52 [32]...ent/webWorker@0.2 [800]: 04/08 16:59:52 [1]...er.GroovyCompiler [800]: GROOVYC: Compiling 'com.zfabrik.samples.groovy_and_java.web/java' using Joint-Compiler... 04/08 16:59:52 [32]...ent/webWorker@0.2 [800]: 04/08 16:59:52 [1]...er.GroovyCompiler [800]: GROOVYC: 'com.zfabrik.samples.groovy_and_java.web/java' successfully compiled. 04/08 16:59:52 [32]...ent/webWorker@0.2 [800]: 04/08 16:59:52 [1]...er.GroovyCompiler [800]: GROOVYC: Total 608ms 04/08 16:59:52 [32]...ent/webWorker@0.2 [800]: 04/08 16:59:52 [1]...pp.WebAppResource [800]: Done starting Web App (/groovy-java-sample): com.zfabrik.samples.groovy_and_java.web/web 0</pre> </pre> If you want to inspect the code using Eclipse, please create a workspace in install (i.e. @install/workspace@) and import the Git repositories and the following projects into your workspace: _core_ from z2-base.core, _environemnt_ and _com.zfabrik.samples.groovy.web_ from z2-samples.groovy (see also [[Step_3_-_First_steps_with_Z2_on_Git|First steps]]).