1.4. Getting the Development Environment Up and Running

This section gives a step-by-step guide for setting up a development environment. IT Mill Toolkit supports a wide variety of tools, so you can use any IDE for writing the code, most web browsers for viewing the results, any operating system or processor supported by the Java 1.5 platform, and almost any Java server for deploying the results.

In this example, we use the following toolchain:

The above is a good choice of tools, but you can use almost any tools you are comfortable with.

Figure 1.3. Development Toolchain and Process

Development Toolchain and Process

Figure 1.3, “Development Toolchain and Process” above illustrates the development environment and process. You develop your application as an Eclipse project. The project must include, in addition to your source code, the IT Mill Toolkit Library package, and the theme package. It can, optionally, include your project-specific themes. When the project is compiled and packaged as a web application (WAR), the IT Mill components are copied to the package. Web Tools Platform for Eclipse allows easy deployment of web applications and debugging them under Tomcat.

1.4.1. Installing Java SDK

Java SDK is required by the Eclipse IDE during development. You may also need it for some other tasks. IT Mill Toolkit is compatible with Java 1.5 and later editions. (Java 1.4 is no longer supported since version 5.3.0 because of the requirements of GWT 1.5.)

Windows

Setting up the Java in Windows XP is really straightforward.

  1. Download the installation packages from:

  2. Install the Java SDK by running the installer. The default options are fine.

Linux / UNIX

Download the following package:

Decompress Java SDK under a suitable base directory, such as /opt. For example, for Java SDK, enter (either as root or with sudo in Linux):
# cd /opt
# sh (path-to-installation-package)/jdk-6u1-linux-i586.bin
and follow the instructions in the installer.

1.4.2. Installing Eclipse IDE

Windows

Setting up the Eclipse IDE in Windows XP is really straightforward.

  1. Download the installation package from:

  2. Decompress the Eclipse IDE package to a suitable directory. You are free to select any directory and to use any ZIP decompressor, but in this example we decompress the ZIP file by just double-clicking it and selecting "Extract all files" task from Windows compressed folder task. In our installation example, we use C:\dev as the target directory.

  3. Eclipse is now installed in C:\dev\eclipse and can be started from there (by clicking eclipse.exe).

Linux / UNIX

You have two basic options for installing Eclipse in Linux and UNIX: you can either install it using the package manager of your operating system or by downloading and installing the packages manually. The manual installation method is recommended, because the latest versions of the packages available in a Linux package repository may be incompatible with Eclipse plugins that are not installed using the package management. The versions mentioned above have been tested to work.

Download the following package:

Decompress the Eclipse package under a suitable base directory. It is important to make sure that there is no old installation in a directory with the same name as installing a new version on top of an old one would probably make Eclipse unusable.

Eclipse should normally be installed as a regular user, as this makes installation of plugins easier. Eclipse also stores some user settings in the installation directory. To install the package, enter:

$ tar zxf (path-to-installation-package)/eclipse-jee-europa-fall-linux-gtk.tar.gz
This will extract the package to a subdirectory with the name eclipse.

You may wish to add the Eclipse installation directory and the bin subdirectory in the installation directory of Java SDK to your system or user PATH.

Alternatively, the package management system of your operating system may provide the packages. For example, in Ubuntu Linux, which includes Sun Java SDK and Eclipse in its APT repository, you can install the programs from a package manager GUI or from command-line with a command such as:

$ sudo apt-get install sun-java6-jdk eclipse

This is not, however, recommended, because the Eclipse package may not include all the necessary Java EE tools, most importantly the Web Standard Tools, and it may cause incompatibilities with some components that are not installed with the package management system of your operating system.

1.4.3. Installing Apache Tomcat

Apache Tomcat is a lightweight Java web server suitable for both development and production. There are many ways to install it, but here we simply decompress the installation package.

Apache Tomcat should be installed with user permissions. During development, you will be running the Eclipse or some other IDE with user permissions, but Eclipse can not deploy web applications to Tomcat that is installed system-wide with administrator or root permissions.

  1. Download the installation package:

    Apache Tomcat 6.0 (Core Binary Distribution) from http://tomcat.apache.org/

  2. Decompress Apache Tomcat package to a suitable target directory, such as C:\dev in Windows or /opt in Linux or Mac OS X. The Apache Tomcat home directory will be C:\dev\apache-tomcat-6.0.x or /opt/apache-tomcat-6.0.x, respectively.

  3. We are now ready to start and configure Eclipse. Start it by running C:\dev\eclipse\eclipse.exe (Windows) or /opt/eclipse/eclipse (Linux or OS X).

  4. When starting Eclipse for the first time, it asks where to save the workspace. You can select any directory, but here we select C:\dev\workspace (Windows) or /home/<user>/workspace (Linux or OS X). We suggest that you also set this as the default.

  5. You can see some Eclipse tutorials on the "Welcome" -screen or go to workbench to continue.

  6. Configure the Tomcat Server by selecting WindowPreferences. Select Web ServicesServer and Runtime from the tree on the left. Set Tomcat version to 6.x. Other defaults are fine.

1.4.4. Firefox and Firebug

Because IT Mill Toolkit supports many web browsers, you can use any of them for development. If you also plan to build any theme parts, like CSS files, customized layouts, or even completely new user interface components, we recommend that you use Firefox for debugging. The toolkit specially supports Firebug debugger and shows special support information there.

To install Firefox, just go to www.mozilla.com and download and run the installer.

After installing Firefox, use it to open http://www.getfirebug.com/ to install latest stable version of Firebug available for the browser. If clicking the Install Firebug 1.0 -button does not open the install window, allow installs from the domain by clicking the yellow warning bar at the top of the browser-window.

When Firebug is installed, it can be enabled at any time from the bottom right corner of the Firefox window. See the example on debugging in Figure 1.4, “Firebug Debugger for Firefox” below.

Figure 1.4. Firebug Debugger for Firefox

Firebug Debugger for Firefox

Now that you have installed the development environment, you can proceed to making your first application.