title: Java/Jython - how to relate unfound classes to specific jar files
body: <p>This also puzzled me when experimenting with the Lucene package... but this is an example now I'm trying to get into HTTP/JSON/URL stuff using Java. In fact I use Jython... as this is not an SSCCE I've left it in the (more concise) Jython.  Java users should have no difficulty understanding.</p>
  
  <p>I got some code from SO explaining how to send a JSON object using Java:</p>
  
  <pre><code>import javax.json
  import org.apache.http.impl.client as httpclient
  
  httpClient = httpclient.HttpClientBuilder.create().build()
  try:
      request = javax.json.HttpPost("http://yoururl") # Rubbish: see below
      params = javax.json.StringEntity(json.toString())
      request.addHeader("content-type", "application/json")
      request.setEntity(params)
      httpClient.execute(request)
  # handle response here...
  except Exception, ex:
      # handle exception here
      print ex
  httpClient.close()
  </code></pre>
  
  <p>when I try to run this, I first get "class not found" for HttpClientBuilder.<br>A bit of googling leads me to <a href="https://hc.apache.org/downloads.cgi" rel="nofollow">https://hc.apache.org/downloads.cgi</a>... so I look at this page and think: it's probably the "HttpClient" download I need... so I download and extract the 10 jar files. I guess that I need to include httpclient-4.4.1.jar.  Correct.</p>
  
  <p>The next thing "class not found" is ConnectionReuseStrategy: I investigate and then include httpcore-4.4.1.jar.  Correct.</p>
  
  <p>After this I get "class not found" for org.apache.commons.logging.LogFactory.  Guessing, I include commons-logging-1.2.jar. Correct.</p>
  
  <p>After this I get </p>
  
  <blockquote>
    <p>'javapackage' object has no attribute 'HttpPost'</p>
  </blockquote>
  
  <p>This Jython message means that I guessed the package "javax.json" for HttpPost incorrectly.<br>
  So I google "HttpPost" and find it is a member of org.apache.http.client.methods.  This doesn't tell me which jar file to include next... I have to guess!</p>
  
  <p>My question is: supposing you can find the (likely) package where a class comes from, can you find how the package relates to an actual jar file?  As I say, this was a big puzzle for me with Lucene, and now with all this Apache HTTP stuff.  </p>