Java: Libary importieren (Programmierung)

Julius @, Deutschland, Donnerstag, 27. Mai 2010, 19:42 (vor 103 Tagen)

Hey Micha,

ich kämpfe jetzt seit einiger Zeit mit einem Problem und habe mich sinnigerweise dazu entschlossen lieber dich zu fragen bevor das noch ausartet :-) Ich möchte im folgenden die Libary HttpClient importieren, leider sagt mir der JavaEditor nur HttpGetDemo.java:1:1: package org.apache.commons.httpclient does not exist.

import org.apache.commons.httpclient.*;
import org.apache.commons.httpclient.methods.GetMethod;
import java.io.IOException;
 
public class HttpGetDemo {
    public static void main(String[] args) {
        HttpClient client = new HttpClient();
        HttpMethod method = new GetMethod("http://www.google.com");
 
        try {
            client.executeMethod(method);
 
            if (method.getStatusCode() == HttpStatus.SC_OK) {
                String response = method.getResponseBodyAsString();
                System.out.println("Response = " + response);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            method.releaseConnection();
        }
    }
}

Meine Konfiguration:

[image]
Vielleicht hast du ja eine Idee? Vielen Dank =)

--
Wenn du eine weise Antwort verlangst, musst du vernünftig fragen.
Johann Wolfgang von Goethe

Tags:
java, libary, import, javaeditor


gesamter Thread:

 RSS-Feed dieser Diskussion