Solved

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

Posted on 2013-12-07
4
577 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Crashing when deleting value with no child in Binary Tree 4 65
android spyware 5 23
Samsung Galaxy Android 7.0 7 67
Code planning methods/tools? 5 56
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.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

734 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