Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-28-2008, 12:34 AM   #1
LQ Newbie
Registered: Jan 2007
Posts: 10

Rep: Reputation: 1
Smile 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?

Old 11-28-2008, 04:15 AM   #2
LQ Newbie
Registered: Jan 2007
Posts: 10

Original Poster
Rep: Reputation: 1
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?

Old 11-28-2008, 04:56 AM   #3
LQ Guru
Registered: Nov 2006
Location: Belgium
Distribution: Ubuntu 11.04, Debian testing
Posts: 5,019

Rep: Reputation: 130Reputation: 130
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.
Old 11-30-2008, 10:19 PM   #4
LQ Newbie
Registered: Jan 2007
Posts: 10

Original Poster
Rep: Reputation: 1
Thumbs up

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,

Last edited by yuubouna; 11-30-2008 at 10:22 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java and Jars ? EAD Programming 6 12-31-2006 03:10 PM
Undefined reference in C++ program Komakino Programming 3 12-03-2006 05:42 PM
Undefined reference to WxGtk libraries when compiling Xchm Darwish Linux - Software 0 09-04-2005 12:11 AM
how can i add all installed fonts in my java program? sanjeebko Programming 0 08-15-2005 07:16 PM
Program not finding java VM libraries gtanghookup Linux - Software 5 09-04-2003 02:20 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:24 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration