• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Referencing Jar files

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic