Step 2 - Install and run in 5 minutes » History » Revision 42
Revision 41 (Henning Blohm, 14.09.2015 10:17) → Revision 42/48 (Henning Blohm, 16.09.2018 16:40)
h1. Install and run Z2 in 5 minutes [[Step_1_-_What_is_z2|« Step 1 - What is z2]] h2. Prerequisites {{include(Java Version Requirements)}} 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]]. 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). That plugin is also available for Intellij. However you can use any IDE (including vi and notepad) together with z2. h2. Creating a _home_ for Z2 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. Create a folder called z2-base inside your favorite/home/development/what-ever directory and enter it: <pre><code> <pre> > mkdir z2-base > cd z2-base </code></pre> </pre> h2. Installing Cloning the z2-base Distribution Z2 core The fastest way to start with z2 As described in [[Step_1_-_What_is_z2|Step 1 - What is by installing z2]] the z2-base distribution that project contains several repositories. You always start with the z2-core and complete copy of the z2-base.base component repository in one installable archive and requires no access to remote repositories (see also [[How_to_create_your_own_system]] for more details). In order to install, "download":https://redmine.z2-environment.net/projects/z2-environment/files _core_ repository. Create a clone from git.z2-environment.net which will checkout the web site "master" branch automatically (output and unpackage. On Mac-OS or Linux run: numbers vary of course): <pre><code> <pre> wget https://redmine.z2-environment.net/attachments/download/428/z2-base-v2.6.zip > git clone http://git.z2-environment.net/z2-base.core unzip z2-base-v2.6.zip Cloning into 'z2-base.core'... </code></pre> remote: Counting objects: 11032, done. remote: Compressing objects: 100% (2402/2402), done. remote: Total 11032 (delta 7705), reused 10733 (delta 7602) Receiving objects: 100% (11032/11032), 18.04 MiB | 222.00 KiB/s, done. Resolving deltas: 100% (7705/7705), done. Checking connectivity... done On Windows download > cd z2-base.core > git branch * master </pre> That's all you need to do in order to install the archive z2-Environment and unpack using you can start the Windows explorer. Make server right away. Before starting, make sure to unpack into the z2-base folder we created before. This will create that you have a folder z2-base.core that contains the complete version 2.6 z2-base working Java installation. h2. Starting To test, type Make sure to have <pre> java -version </pre> on a command line. This should output some information on your Java Development Kit (JDK) or a Java Runtime Environment of version 9 1.6 or 10 installed higher. h2. Starting the z2-Environment The start scripts are located inside @run/bin@ and executable. Test this by running <pre><code> 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. <pre> java -version > cd run/bin </code></pre> > ./go.sh Start 03/08 20:30:29 [1]...hers.HomeLauncher [800]: Z2 Home Launcher, (c) 2010-2013 ZFabrik Software KG 03/08 20:30:30 [1]...ProcessRunnerImpl [800]: Running core build 201310071127 as hb in z2 home /home/hb/copy/install/z2-base.core, timezone Europe/Berlin, language en, region null 03/08 20:30:30 [1]...ProcessRunnerImpl [800]: Using VM v1.7.0_09 by running <pre><code> Oracle Corporation at /usr/lib/jvm/jdk1.7.0_09/jre on Linux (arch: 3.11.0-17-generic) z2-base.core/bin/gui.sh 03/08 20:30:30 [1]...ProcessRunnerImpl [800]: ************************************ </code></pre> 03/08 20:30:30 [1]...ProcessRunnerImpl [800]: *** Running in DEVELOPMENT mode! *** 03/08 20:30:30 [1]...ProcessRunnerImpl [800]: ************************************ 03/08 20:30:30 [1]...entRepositoryImpl [800]: Using GIT-CR: component:com.zfabrik.boot.config/baseRepository,repo:95f655a0,prio:500,checkDepth:1073741823,fileSystem:fs-root:/home/hb/copy/install/z2-base.core/work/repos/95f655a0/git,origin:http://git.z2-environment.net/z2-base.base,branch:master,optional:true 03/08 20:30:30 [1]...entRepositoryImpl [800]: Cloning GIT-CR: component:com.zfabrik.boot.config/baseRepository,repo:95f655a0,prio:500,checkDepth:1073741823,fileSystem:fs-root:/home/hb/copy/install/z2-base.core/work/repos/95f655a0/git,origin:http://git.z2-environment.net/z2-base.base,branch:master,optional:true. This will take some seconds... 03/08 20:31:58 [1]...entRepositoryImpl [800]: Created working-clone within 88266 msec for GIT-CR: component:com.zfabrik.boot.config/baseRepository,repo:95f655a0,prio:500,checkDepth:1073741823,fileSystem:fs-root:/home/hb/copy/install/z2-base.core/work/repos/95f655a0/git,origin:http://git.z2-environment.net/z2-base.base,branch:master,optional:true 03/08 20:31:58 [1]...devcr.DevRepoImpl [800]: Dev Repository: Registered component:com.zfabrik.dev.repo/devRepo,repo:7ea65360,prio:750, workspaces (1): [/home/hb/copy/install] 03/08 20:31:58 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/bootrepo_up 03/08 20:31:58 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/sysrepo_up 03/08 20:32:01 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/process_up 03/08 20:32:01 [18]...ent/webWorker@0.1 [800]: Listening for transport dt_socket at address: 5100 03/08 20:32:01 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:01 [1]...ProcessRunnerImpl [800]: Running core build 201310071127 as hb in z2 home /home/hb/copy/install/z2-base.core, timezone , language en, region null 03/08 20:32:01 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:01 [1]...ProcessRunnerImpl [800]: Using VM v1.7.0_09 by Oracle Corporation at /usr/lib/jvm/jdk1.7.0_09/jre on Mac-OS or Linux, or <pre><code> Linux (arch: 3.11.0-17-generic) z2-base.core/bin/gui.bat 03/08 20:32:01 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:01 [1]...devcr.DevRepoImpl [800]: Dev Repository: Registered component:com.zfabrik.dev.repo/devRepo,repo:7ea65360,prio:750, workspaces (1): [/home/hb/copy/install] </code></pre> 03/08 20:32:01 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:01 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/bootrepo_up 03/08 20:32:01 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:01 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/sysrepo_up 03/08 20:32:01 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:01 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/process_up 03/08 20:32:01 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:01 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/worker_up 03/08 20:32:02 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:02 [1]...pp.WebAppResource [800]: Starting WebApp: com.zfabrik.dev.z2unit/web 03/08 20:32:02 [18]...ent/webWorker@0.1 [800]: INFO org.eclipse.jetty.server.Server - jetty-8.1.11.v20130520 03/08 20:32:02 [18]...ent/webWorker@0.1 [800]: INFO org.eclipse.jetty.server.AbstractConnector - Started SelectChannelConnector@0.0.0.0:8080 03/08 20:32:03 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:03 [1]...pp.WebAppResource [800]: Done starting Web App (/z2unit): com.zfabrik.dev.z2unit/web 03/08 20:32:03 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:03 [1]...pp.WebAppResource [800]: Starting WebApp: com.zfabrik.dev.eclipsoid.srv/web 03/08 20:32:03 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:03 [1]...pp.WebAppResource [800]: Done starting Web App (/eclipsoid): com.zfabrik.dev.eclipsoid.srv/web 03/08 20:32:03 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:03 [1]...pp.WebAppResource [800]: Starting WebApp: com.zfabrik.samples.calculator/web 03/08 20:32:03 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:03 [1]...pp.WebAppResource [800]: Done starting Web App (/calc): com.zfabrik.samples.calculator/web 03/08 20:32:03 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:03 [1]...pp.WebAppResource [800]: Starting WebApp: com.zfabrik.dev.javadoc/web 03/08 20:32:03 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:03 [1]...pp.WebAppResource [800]: Done starting Web App (/javadoc): com.zfabrik.dev.javadoc/web 03/08 20:32:04 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:04 [1]...pp.WebAppResource [800]: Starting WebApp: com.zfabrik.admin/web 03/08 20:32:04 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:04 [1]...pp.WebAppResource [800]: Done starting Web App (/adm): com.zfabrik.admin/web 03/08 20:32:04 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:04 [1]...stemStateResource [800]: Attained system state: environment/webWorkerUp 03/08 20:32:04 [19]...ent/webWorker@0.2 [800]: 03/08 20:32:04 [1]...worker.WorkerSoul [800]: Completed worker process initialization 03/08 20:32:04 [1]...stemStateResource [800]: Attained system state: com.zfabrik.boot.main/home_up 03/08 20:32:04 [1]...hers.HomeLauncher [800]: Completed home process initialization press (q)uit, (c)omponents, (f)oundation props, (s)ystem props, s(y)nc repo, (v)erify, (g)c:> </pre> *Note:* On first startup the runtime needs to clone (and so download) its base repository ("z2-base.base":https://redmine.z2-environment.net/projects/z2-base/repository/base). Dependending on Windows. your network bandwidth this may require anything between a few seconds to some minutes. Subsequent startups will not require this step again. That's it. When you see the prompt above, the z2-Environment is up and running and excepting requests on localhost port 8080. To verify, open the administration page at http://localhost:8080/adm. Use username *z** ("z" followed by an asterisk) and password *z*. h2. What's Next Essentially the same procedure is used to install the z2-Environment in production. From a system installation point of view, checking out a core distribution as we just did is all that needs to be done. This tutorial On the next page we will continue by showing you how do some first development step with z2 in combination with the Eclipse IDE. As it is handy to develop with Z2. If run the z2 server from inside Eclipse, so you ask yourself how to add remote repositories, please check out [[How_to_create_your_own_system]]. should stop the running server now by pressing 'q'. * [[Step 3 - First steps with Z2 on Git|» Step 3 - First steps with Z2 on Git]] * [[Step 3 - First steps with Z2 on SVN|» Step 3 - First steps with Z2 on SVN]]