1.1. Obtaining Commons Lang
Problem
You want to use Commons Lang because your program needs to use some of the simple utilities this component provides, such as array manipulation, date manipulation, and enums.
Solution
To download the latest version of Commons Lang, follow these steps:
In a web browser, open the URL http://jakarta.apache.org/site/binindex.cgi. This URL will select a mirror, and generate a page with links to download binary distributions from an Apache mirror.
Find the Commons Lang project section. If you search for the term “Commons Lang,” you will find a section that provides a link to download the latest binary release of Commons Lang.
Click on either the
2.0 zipor2.0 tar.gz(depending on your platform) to download Commons Lang 2.0.Unzip or untar the binary distribution. This will create a directory named
commons-lang-2.0. Thecommons-lang-2.0directory should now contain a Java Archive (JAR) file,commons-lang-2.0.jar.Copy or add
commons-lang-2.0.jarto your classpath.
Discussion
Step #5 varies based on your development environment. If you are working with Apache Ant as a build tool, you will need to make sure that your classpath includes the Commons Lang JAR. If you are using an Integrated Development Environment (IDE) like Eclipse, you will need to copy this JAR to a directory in your project, and alter your project’s preferences to add Commons Lang 2.0 to the “Java Build Path.” If you are using Maven as a build tool, add the following dependency to the dependencies ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access