Solved

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

Posted on 2013-12-07
4
568 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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
hibernate example using maven 12 42
How to delete multiple contacts in MI 3 Note? 2 36
How to determine if a string is a valid SHA value 7 33
why no phone sync 11 28
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is about my first experience with programming Arduino.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

773 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