views:

51

answers:

2

I have downloaded a complete package of Java product and trying to compile it using Ant. The project compiles with many errors, mostly related to imports starting with "org.apache.commons". I'm new to Java. It looks to me that some system component is missing.

Some of the errors are:

package org.apache.commons.logging does not exist

package com.ibm.icu.text does not exist

cannot find symbol

What should I do to get rid of those errors?

+1  A: 

org.apache.commons.logging and com.ibm.icu.text are third party Java libraries. Download them from their websites and include in the Java classpath.

Update

Classpath is a list of file system paths which defines the locations of Java classes and libraries. JVM uses this to load the class it needs in the runtime. Usual practice is to put all libraries in a sub folder called 'lib' then add '\lib' in the classpath. My advice is to use a graphical tool like Eclipse so you don't need to manually do this. Please read this wikipedia article for more info about Classpath.

Sujee
Can you tell me where is the "classpath" so I can add those libraries?
Sphynx
+1  A: 

As Sujee has said you need to include 2 jar files in your classpath. You can find the jars here:

http://download.icu-project.org/files/icu4j/4.4.1.1/icu4j-4_4_1_1.jar http://apache.forthnet.gr/commons/logging/binaries/commons-logging-1.1.1-bin.zip

Savvas Dalkitsis