Java: Libary importieren (Programmierung)
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]](http://i46.tinypic.com/2ec12du.jpg)
Vielleicht hast du ja eine Idee? Vielen Dank =)
--
Wenn du eine weise Antwort verlangst, musst du vernünftig fragen.
Johann Wolfgang von Goethe
