-   Linux - Newbie (
-   -   how to add external jars, Java program with Reference Libraries (

yuubouna 11-27-2008 11:34 PM

how to add external jars, Java program with Reference Libraries
I have a Java program, that reference to external libraries.

for e.q. reference to:

I am not sure where to put the reference library and setting up.
Do I need to add that also in Path settings?


yuubouna 11-28-2008 03:15 AM

I made my java programs run by including unzip jar files of:
poi-3.5-beta3-20080926.jar, in order to reference the class files my Java program required.

My directory structured looks like the ff:
[org] - directory where poi-3.5-beta3-20080926.jar unzip files where located - java files that reads the

But I think this setting not flexible.

Anybody knows how to make a reference to a jar files?


jay73 11-28-2008 03:56 AM

You need to place the jar on your classpath. To do so, open your .(bash)_profile or your /etc/profile and add
export CLASSPATH=/path/to/jar:$CLASSPATH
You will then need to source the file in question or log out and back in.

yuubouna 11-30-2008 09:19 PM

Hello Jay, thanks!
Yes, exactly that`s what I did.

I found that my classpath settings mistakes in calling the Apache Poi JAR files.
Changing it in order to call the JARs solved my problems.

in my .bash_profile, I append the following:
export APACHE_POI=/home/me/poi-3.5-beta3 ---> (Here where JAR`S Files are located.)

checking to see if its set:


APACHE_POI classpath where now setup, properly.
I don`t need either the unzip files of the Jars located in /home/me/poi-3.5-beta3.

(^-^)/ Cheers,

All times are GMT -5. The time now is 07:29 PM.