O'Reilly logo

Java Power Tools by John Ferguson Smart

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Part I. Build Tools

“It just shows what can be done by taking a little trouble,” said Eeyore. “Do you see, Pooh? Do you see, Piglet? Brains first and then Hard Work. Look at it! That’s the way to build a house.”

“A House is Built at Pooh Corner for Eeyore,” The House at Pooh Corner, A. A. Milne

Putting some thought and effort into planning your build process from the outset can pay off abundantly further on down the line, when the going gets tough and the pressure is on. This is where a well-designed build process and fine-tuned build tools show their worth.

Like many things, in IT and elsewhere, build tools are primarily the fruit of human laziness. Compiling C or C++ (or Java, for that matter) from the command line is a terribly tedious affair. And, in the Unix world, where scripts abound, the next step was natural: why not write a script to do it for you? A basic shell script written to compile a few C source code files was probably the oldest ancestor of our modern Java build tools such as Ant and Maven.

Shell scripts work fine for a small number of source code files, but this approach is difficult to scale to larger applications. This is where Make enters the scene. Make is the principal Unix build tool, and anyone familiar with linux or Unix will have come across it at some stage. A makefile (the name of the scripts run by Make) is basically a list of instructions used to compile your application. The idea is to automate the build process, by working out exactly what files need ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required