1.3. Getting the Commons Lang Source Code

Problem

You want to view the source code for the Commons Lang project.

Solution

Download the source code from http://jakarta.apache.org/site/sourceindex.cgi. Following the same procedure as outlined in Recipe 1.1, you can download a file named commons-lang-2.0-src.zip (or commons-lang-2.0-src.tar.gz). Once you unzip this file, you will have the source to Commons Lang in ./commons-lang-2.0-src.

Discussion

The commons-lang-2.0-src directory will contain the following:

build.xml

An Apache Ant build file, which you can use to compile the source. If Ant is installed, you can compile or test by running ant compile or ant test.

src/java

This subdirectory contains the source for the classes in Commons Lang.

src/test

This subdirectory contains unit tests for the Commons Lang project. Each *Test.java file is an extension of JUnit TestCase class.

See Also

For more information about Apache Ant, see the Ant project page at http://ant.apache.org. Also see Chapter 3 in the Java Extreme Programming Cookbook by Eric M. Burke and Brian M. Coyner (O’Reilly).

The unit tests in this source distribution use the JUnit testing framework. For more information about JUnit, see the JUnit project page at http://www.junit.org. Also see Chapter 4 in the Java Extreme Programming Cookbook by Burke and Coyner.

See Recipe 1.1 for information about obtaining the binary distribution for Commons Lang, and see the Commons Lang web site at http://jakarta.apache.org/commons/lang.

Get Jakarta Commons Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.