我試圖執行從HTMLUnit tutorial此代碼:的Java的HtmlUnit MalformedURLException的
final WebClient webClient = new WebClient();
final HtmlPage page = webClient.getPage("http://htmlunit.sourceforge.net");
但在Eclipse中保存它時,我得到了MalformedURLException的第二行(如果我編譯和運行代碼,我得到它也)。有什麼問題? TIA
PS:我是新來的Java
最多:
這裏的堆棧跟蹤:
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/httpclient/auth/CredentialsProvider
at Tester.main(Tester.java:12)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.auth.CredentialsProvider
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 1 more