Step 2 - Install and run in 5 minutes » History » Version 31
Henning Blohm, 05.03.2014 09:52
1 | 22 | Henning Blohm | h1. Install and run Z2 in 5 minutes |
---|---|---|---|
2 | 1 | Udo Offermann | |
3 | 18 | Udo Offermann | [[Step_1_-_What_is_z2|« Step 1 - What is z2]] |
4 | 1 | Udo Offermann | |
5 | h2. Prerequisites |
||
6 | |||
7 | 30 | Henning Blohm | You need a properly setup JDK 6 or 7 on Linux, Mac OS X or Windows - that's all. |
8 | 1 | Udo Offermann | A halfway modern system will do. |
9 | |||
10 | 26 | Udo Offermann | This how-to uses the "Git":http://git-scm.com/ VCS, which has to be installed on your system (we're using Git version 1.7). You can also run Z2 with SVN as described on [[Step 4 - First steps with Z2 on SVN]]. |
11 | 23 | Udo Offermann | |
12 | 30 | Henning Blohm | It is beneficial to use the Eclipse IDE (Ganymed, Helios, Indigo, Kepler work all fine). There's a small Eclipse plug-in called "Eclipsoid" which makes it easier to develop z2 applications within Eclipse (see [[Step 3 - First steps with Z2 on Git]] for more details). However you can use any IDE (including vi and notepad) together with z2. |
13 | 1 | Udo Offermann | |
14 | 28 | Udo Offermann | h2. Creating a _home_ for Z2 |
15 | 1 | Udo Offermann | |
16 | 28 | Udo Offermann | This is a best practice approach (and other approaches are possible). We recommend to keep the repositories and the IDE workspace close together. This way we don't need to adjust the path settings in the Z2 configuration files and they can remain relative paths. |
17 | 1 | Udo Offermann | |
18 | Create a folder called z2-base inside your favorite/home/development/what-ever directory and enter it: |
||
19 | |||
20 | <pre> |
||
21 | 29 | Udo Offermann | mkdir z2-base |
22 | cd z2-base |
||
23 | 1 | Udo Offermann | </pre> |
24 | |||
25 | 20 | Henning Blohm | h2. Cloning the Z2 core |
26 | 1 | Udo Offermann | |
27 | 19 | Udo Offermann | As described in [[Step_1_-_What_is_z2|Step 1 - What is z2]] the z2-base project contains several repositories. |
28 | 30 | Henning Blohm | You always start with the _core_ repository. Create a clone from git.z2-environment.net which will checkout the "master" branch automatically: |
29 | 1 | Udo Offermann | |
30 | <pre> |
||
31 | 29 | Udo Offermann | git clone http://git.z2-environment.net/z2-base.core |
32 | 13 | Udo Offermann | Cloning into core... |
33 | 3 | Udo Offermann | |
34 | 29 | Udo Offermann | cd z2-base.core |
35 | 1 | Udo Offermann | git branch |
36 | 30 | Henning Blohm | * master |
37 | 1 | Udo Offermann | </pre> |
38 | |||
39 | 30 | Henning Blohm | That's all you need to do in order to install the z2-Environment and you can start the server right away. Before starting, make sure that you have a working Java installation. To test, type |
40 | |||
41 | <pre> |
||
42 | java -version |
||
43 | </pre> |
||
44 | |||
45 | on a command line. This should output some information on your Java Development Kit of version 1.6 or higher. |
||
46 | 1 | Udo Offermann | |
47 | 21 | Henning Blohm | h2. Starting the z2-Environment |
48 | 1 | Udo Offermann | |
49 | 10 | Udo Offermann | The start scripts are located inside @run/bin@ and are called _go.sh_ on Unix based systems like Linux and Mac OS and _go.bat_ on Windows. There's also a gui-based version that we will discover later. |
50 | 1 | Udo Offermann | |
51 | <pre> |
||
52 | 29 | Udo Offermann | cd run/bin |
53 | ./go.sh & |
||
54 | 13 | Udo Offermann | 09/10 15:59:10 [1]...hers.HomeLauncher[800]: Z2 Home Launcher, (c) ZFabrik Software KG 2010, 2011, 2012 |
55 | 09/10 15:59:10 [1]...ProcessRunnerImpl[800]: Running core build 201208241554 as udoo in z2 home /Users/udoo/dev/temp/z2-base-v2.1/z2-base.core/run/bin/../.., timezone Europe/Berlin, language de, region null |
||
56 | 09/10 15:59:10 [1]...ProcessRunnerImpl[800]: Using VM v1.6.0_35 by Apple Inc. at /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home on Mac OS X (arch: 10.6.8) |
||
57 | 09/10 15:59:10 [1]...ProcessRunnerImpl[800]: ************************************ |
||
58 | 09/10 15:59:10 [1]...ProcessRunnerImpl[800]: *** Running in DEVELOPMENT mode! *** |
||
59 | 09/10 15:59:10 [1]...ProcessRunnerImpl[800]: ************************************ |
||
60 | 09/10 15:59:10 [1]...entRepositoryImpl[800]: Using GitCR com.zfabrik.boot.config/systemRepository (origin=http://git.z2-environment.net/z2-base.base, branch=v2.1) com.zfabrik.impl.gitcr.GitComponentRepositoryImpl@71b8b3bb,repo:246d0e3e, component:com.zfabrik.boot.config/systemRepository, prio:500, checkDepth:1073741823, fileSystem:com.zfabrik.components.provider.fs.FileSystemImpl@151ff451, root:/Users/udoo/dev/temp/z2-base-v2.1/z2-base.core/run/bin/../../work/repos/246d0e3e/git |
||
61 | 09/10 15:59:12 [1]...entRepositoryImpl[800]: Pulled deltas from GitCR com.zfabrik.boot.config/systemRepository (origin=http://git.z2-environment.net/z2-base.base, branch=v2.1) within 1684msec |
||
62 | ... |
||
63 | 09/10 15:59:12 [18]...ent/webWorker@0.1[800]: Listening for transport dt_socket at address: 5100 |
||
64 | ... |
||
65 | 09/10 15:59:13 [18]...ent/webWorker@0.1[800]: INFO org.eclipse.jetty.server.AbstractConnector - Started SelectChannelConnector@0.0.0.0:8080 |
||
66 | ... |
||
67 | 09/10 15:59:16 [1]...stemStateResource[800]: System state attained: com.zfabrik.boot.main/home_up |
||
68 | 09/10 15:59:16 [1]...hers.HomeLauncher[800]: Completed home process initialization |
||
69 | 3 | Udo Offermann | |
70 | 13 | Udo Offermann | press (q)uit, (c)omponents, (f)oundation props, (s)ystem props, s(y)nc repo, (v)erify, (g)c:> |
71 | 1 | Udo Offermann | |
72 | 10 | Udo Offermann | </pre> |
73 | 3 | Udo Offermann | |
74 | 31 | Henning Blohm | *Note:* On first startup the runtime needs to clone its base repository ("z2-base.base":https://redmine.z2-environment.net/projects/z2-base/repository/base). Dependending on your network bandwidth this may require anything between a few seconds to some minutes. Subsequent startups will not require this step again. |
75 | |||
76 | 20 | Henning Blohm | This means the z2-Environment is up and running and excepting requests on localhost port 8080, just try it: http://localhost:8080/helloworld. |
77 | |||
78 | The same procedure is used to install the z2-Environment in production. From a system installation point of view, this is all what you have to do! |
||
79 | 10 | Udo Offermann | |
80 | 16 | Udo Offermann | On the next page we will do some first development step with z2 in combination with the Eclipse IDE. It's quite handy to run the z2 server from inside Eclipse, so you should stop the running server now by pressing 'q'. |
81 | 1 | Udo Offermann | |
82 | 27 | Udo Offermann | [[Step 3 - First steps with Z2 on Git|» Step 3 - First steps with Z2 on Git]] |