Solved

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

Posted on 2013-12-07
4
555 Views
Last Modified: 2013-12-24
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
Comment
Question by:kpbarem
4 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 39704152
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
 
LVL 35

Accepted Solution

by:
mccarl earned 500 total points
ID: 39707727
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
 

Author Closing Comment

by:kpbarem
ID: 39738519
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

The case of the missing phone talks about the way a small electronic gadget (the mobile phone) has penetrated into our lives and has made us addicted to it.
You should read OS supplied guidelines before developing. I can't stress that enough. The guidelines will help you understand the reasons mobile app developers do what they do.  Apple is very particular when they review appstore submissions.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now