Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Referencing Jar files

 
Anjanesh Lekshminarayanan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Anjanesh Lekshminarayanan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic