• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 629
  • Last Modified:

How to add org.apache.http jars to project in Eclipse for Android

This seems fairly obvious, but I feel like I may be missing something.  I downloaded 2 necessary jars to use for my project (org.apache.httpclient and org.apache.http),  I added these jars to the classpath by going to projet configure build path and going to 'Add External Jar'  This takes care of all compile errors, but at runtime I'm getting a class not found exception on these classes.  I am not sure if I am missing something or if these are simply bad jars.  I don't have a lot of experience doing this.  Could anyone offer some guidance?
0
kpbarem
Asked:
kpbarem
1 Solution
 
CEHJCommented:
Well it would seem that the runtime classpath is not picking them up. Not doing Android, i can't tell you how the config should go, but that will be the reason for the error
0
 
mccarlIT Business Systems Analyst / Software DeveloperCommented:
Ok, firstly, I don't have a lot of experience in Android, but since you haven't received any other Android specific help, I will give you some ideas to try...

If you don't already have a "libs" folder in your Android project, create a folder called "libs" directly in your project folder. Move the downloaded jar files into this directory. Go into the "Configure Build Path" screen that you mention above, and remove the current references that you have to those jars an then instead of "Add External JARs" just use the "Add JARs" button and navigate to those jar files inside your project/libs folder. While you are in that screen, go to the "Order and Export" tab and select the checkbox next to the jar files that you have added.

Now try to build your project, and see how you go. If you still have issues, can you please post the full ClassNotFoundException message that you are given, it may contain further clues.
0
 
kpbaremAuthor Commented:
This gave me a starting point to play with it a little bit.  I'm not entirely sure how, but I got it to work.  Thank you!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now