Results 1 to 4 of 4
  1. #1
    achab is offline Member
    Join Date
    Nov 2010
    Posts
    26
    Rep Power
    0

    Default package org.apache.httpcomponents.httpclient.debian does not ex

    achab@ZT:~/softdev/experimenting$ javac WebHttpClient.java
    WebHttpClient.java:4: package org.apache.httpcomponents.httpclient.debian does not exist

    Java Code:
    import java.io.*;
    import java.util.*;
    import java.net.*;
    import org.apache.httpcomponents.httpclient.debian.*;
    achab@ZT:~/softdev/experimenting$ echo $CLASSPATH
    /usr/share/maven-repo/:/usr/share/maven-repo/org/apache/httpcomponents/httpclient/debian

    root@ZT:/usr/share/maven-repo/org/apache/httpcomponents/httpclient/debian# ls
    httpclient-debian.jar httpclient-debian.pom

    What's wrong ?

  2. #2
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    10

    Default

    Remove those two things from your CLASSPATH environment variable, that isn't really used anymore. If you are runinng/compiling from the command line then include the jar listed above on your classpath (not the directory containing it, the actual jar) using the -cp option. If you are using an IDE then include that jar as a library in your project.

  3. #3
    achab is offline Member
    Join Date
    Nov 2010
    Posts
    26
    Rep Power
    0

    Default

    Quote Originally Posted by masijade View Post
    Remove those two things from your CLASSPATH environment variable, that isn't really used anymore. If you are runinng/compiling from the command line then include the jar listed above on your classpath (not the directory containing it, the actual jar) using the -cp option. If you are using an IDE then include that jar as a library in your project.
    Thanks. I have done that, and I am getting the following compilation error:

    achab@ZT:~/softdev/experimenting$ javac WebHttpClient.java -cp /usr/share/maven-repo/org/apache/httpcomponents/httpclient/debian/httpclient-debian.jar
    WebHttpClient.java:10: cannot find symbol
    symbol : class HttpClient

    Why is the compiler not finding the HttpClient class in httpclient-debian.jar ?

    Abdenour

  4. #4
    masijade is offline Senior Member
    Join Date
    Jun 2008
    Posts
    2,571
    Rep Power
    10

    Default

    A jar file is nothing but a zipfile with a different ending. Open it and see if it's in there, and make sure you have the package right.

Similar Threads

  1. How to interact with Web page? ( HttpComponents)
    By featon in forum New To Java
    Replies: 0
    Last Post: 05-28-2010, 11:58 PM
  2. login with cookies using Apache httpClient
    By MacGyver in forum Advanced Java
    Replies: 0
    Last Post: 05-15-2010, 03:21 PM
  3. debian package
    By jperson in forum Advanced Java
    Replies: 3
    Last Post: 01-19-2010, 03:53 PM
  4. Replies: 8
    Last Post: 03-31-2009, 11:56 PM
  5. JVM error when starting Eclipse[with Debian]
    By cakirhal in forum Eclipse
    Replies: 0
    Last Post: 03-07-2009, 09:07 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •