Installing And Building ZK On Windows Systems

From Documentation
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
DocumentationSmall Talks2006NovemberInstalling And Building ZK On Windows Systems
Installing And Building ZK On Windows Systems

Author
Daniele Viazzi, Graduating Student, Computer Engineering at the University of Genoa.
Date
November 03, 2006
Version
ZK Studio 0.9


INTRODUCTION

This guide was written and tested using the following software versions. If you can make it work with different versions, please report it to the community.

  • Tomcat 5.5.17 (or VmWare Player 1.0.2 and Tomcat Virtual Applinace 1.0)
  • zk 2.1.2 or zk-2.1.3
  • JDK 1.5.0 build 09 (without NetBeans SDK)
  • Ant 1.6.2
  • Cygwin 1.5.21-1


INSTALLATION

Installing Tomcat

  • Download Tomcat from here: http://archive.apache.org/dist/tomcat/tomcat-5/
  • Run the installation file in an account with Administrator privileges
  • In order to install Tomcat the java Runtime Enviroment is required
  • Follow the installation instructions: choose the connector port (for example 8080) and choose a Username and a password. (Remember: if you have a firewall, enable the port used by Tomcat)
  • Run Tomcat and visit your localhost page (for example http://localhost:8080/) using your web browser


ALTERNATIVELY

Tomcat can be installed on a virtual machine too. I used VmWare Player as virtual machine and Tomcat Application Server Virtual Appliance as virtual Tomcat server. Here you can find the software:

Installing ZK libraries

  • Download the compressed file containing ZK libraries, for example zk-2.1.3.zip. you can find it here: http://www.zkoss.org/download/
  • Extract the files in any directory
  • Copy all the .jar files contained in ZK subdirectories "\dist\lib\" and "\dist\lib\ext\" (only files) in Tomcat's subdirectory "\shared\lib\"
  • If you use VmWare Player and Virtual Appliances you have to copy the .jar files in the "\WEB-INF\lib" subdirectory of all your projects, after their deployment (create it if not present)


Testing ZK

You can find further information about zkdemo in the Quick Start Guide, here: http://www.zkoss.org/doc/

BUILDING ZK SOURCES

Requisites

Java Development Kit

  • Install the JDK on your system (http://java.sun.com/javase/downloads/index.jsp)
  • Add Java's "\bin" subdirectory path to the enviroment varialbe PATH (for example \jdk1.5.0_09\bin\)
  • Create a new enviroment variable called JAVA_HOME, which will contain the path of Java's main directory (without \bin), for example "Program Files\Java\jdk1.5.0_09"

In order to create or modify an enviroment variable under Windows XP you have to go to Control Panel --> System --> Advanced --> Enviroment Variables. This modification is permanent (until modified again). Else you can create a batch file containing all the necessary instructions (in the form "SET NAME=VALUE") and launch it only when you need.

Ant

  • Download the compressed file containing Ant. You can find it here: http://archive.apache.org/dist/ant/binaries/
  • Extract all the files in a short, space-free path (C:\Ant is OK), since Cygwin (see chapter 2.1.3) may have some problems in converting long paths from Windows format to Unix format and vice versa
  • Add Ant's "\bin" subdirectory to the enviroment variable PATH (for example C:\Ant\bin\)
  • Create a new enviroment variable called ANT_HOME, which will contain the path of Ant's main directory (for example C:\Ant)
  • In order to verify if Ant has been installed correctly, type "ant -version" on your command line: you should see your Ant version information

Cygwin

A bash script is used to build ZK, so under Windows systems you need Cygwin.

  • Download setup.exe from http://www.cygwin.com/ (clicking on the "Install Cygwin now" icon) and execute it
  • When choosing the directory in which Cygwin will be installed, make sure to use a short, space-free path, like "C:\Cygwin"
  • Install the package called "devel"
  • Once the installation is complete, add Cygwin's "\bin" subdirectory path to the enviroment variable PATH (for example C:\Cygwin\bin\)


Getting the ZK sources

  • Download the compressed file containing the zk sources (for example zk-src-2-1-2.tar.gz). you can find it here: http://www.zkoss.org/download/
  • Extract all files in a directory, for example C:\zk-src


Building ZK

  • Start a Cygwin shell, you'll work from here
  • "cd" to the directory containing the source files
  • Type "./build". This will invoke the bash script that will build the project using the Ant buildfile called build.xml
  • Each .jar files will be created in the "\debug" subdirectory related to the component: for example zul.jar will be stored in "\zul\debug"


Ruler.gif


I would like to thank Henri Chen for the help given on the ZK Forums


Ruler.gif


Daniele Viazzi is graduating in Computer Engineering at the University of Genoa. His thesis is about the development of ajax components for the interface/GUI of a remote web-based electronics laboratory.





Copyright © Daniele Viazzi. This article is licensed under GNU Free Documentation License.