aspose file tools*
The moose likes Beginning Java and the fly likes Referencing Jar files Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Referencing Jar files" Watch "Referencing Jar files" New topic
Author

Referencing Jar files

Anjanesh Lekshminarayanan
Ranch Hand

Joined: Oct 21, 2003
Posts: 46
Hi

I extracted a .zip file to the same folder where my java files reside.
The zip extracted is a folder containing jar files located at
httpcomponents-client-4.0-alpha2\lib

javac currently shows package-not-found errors when I try to import
import org.apache.commons.httpclient.Cookie;
How do I get it to recognize those 4 jars ?

Thanks


Anjanesh Lekshminarayanan
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

You need to add httpcomponents-client-4.0-alpha2\lib to your CLASSPATH when you compile

e.g. javac -cp .\httpcomponents-client-4.0-alpha2\lib\NameOfYourJARFile.jar *.java

Cheers,
Martijn

[ December 12, 2007: Message edited by: Martijn Verburg ]
[ December 12, 2007: Message edited by: Martijn Verburg ]

Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Anjanesh Lekshminarayanan
Ranch Hand

Joined: Oct 21, 2003
Posts: 46
Still didnt work.
But giving the full jar name worked.

javac -classpath httpcomponents-client-4.0-alpha2/lib/httpcore-4.0-alpha6.jar myProg.java
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Referencing Jar files
 
Similar Threads
POI
Getting Invalid Package Error while connecting to Oracle
Can't run/import a downloaded applet
Problem while uploading an image using UploadBean
PDFBox und Lucene in Eclipse und Netbeans