Thursday, October 13, 2011

Configuring My Java Build Environment

In my efforts to improve my programming skills, I have decided to get back into Java programming and building large projects. My previous involvement with a large Java project was seven years ago as a university of Hawaii student with the CLEW system. The Collaborative Educational Website (CLEW) was a web application development framework for collegiate department websites.

Environment Configuration

The current laptop I will be working on is a Toshiba Satellite A505 running on Windows 7 64-bit. It has a 1.60 GHz processor, 4 GB RAM, and over 100 GB of free space. My first step is to create a high quality Java software development environment. I downloaded and installed the Java 7 JDK and JavaDoc documentation. I added %java%/bin to my computers PATH variable. I downloaded and installed the Eclipse 3.6.2 IDE. I chose "Eclipse IDE for Java EE Developers" to work on the Java projects. To improve the performance of Eclipse, I modified some runtime options. Increase the heap space for Eclipse. I have at least 2GB RAM. In the eclipse.ini file, I changed -Xms=40m to -Xms=512m and -Xmx=512m to -Xmx=1024m.

To verify my configuration was working, I wrote a couple of basic programs in my eclipse IDE. I wrote the generic HelloWorld program that worked fine. I wanted to try something else so I searched online and found a simple program to implement called FizzBuzz. FizzBuzz is a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz". I was able to implement a working FizzBuzz program. My initial configuration was working.

Build System

This is the point in my configuration where I am stuck. The build system I used for CLEW included apache ant, jakarta tomcat, junit, checkstyle, and other tools. Are these tools still relevant?

In my research for build tools, the top two I came across were Ant and Maven. Ant is open source, Java-based, extensible, and uses XML configuration files. Maven is project management technology that uses convention over configuration. Ant is still very popular and I am familiar with the Ant concepts. Every project requires an Ant build file, build.xml. Each build file is composed of targets. Each target is composed of tasks. And targets can have dependencies.

I downloaded and installed Apache Ant 1.8.1. I added %ant%/bin to my computers PATH variable.

Now What?

Next in configuring my Java build environment will be to include the different tools to help build a working project. I will look into junit, checkstyle, and other tools currently being adopted. When I get a build environment up and running, I will begin my Java programming.

No comments: