I am a programming enthusiast with a basic programming background, but I’m completely new to the Java programming language.
I want to learn how a simple web crawler is built and I’m using this site to compile the source to see how it works and see it in action!
http://java.sun.com/developer/technicalArticles/ThirdParty/WebCrawler/#demo
The source provided by the website is here:
http://java.sun.com/developer/technicalArticles/ThirdParty/WebCrawler/WebCrawler.java
I am running eclipse 3.2 and using the sun-java-6 JRE to compile applets. I am running on Crunchbang, a Ubuntu distro.
There is some part of the library that I am unfamiliar with and do not know how to fix.
List listmatches;
The error says that “The type List is ambiguous“.
I have the package java.utils.*; but the error still persist.
Is there something wrong with my syntax or is there a new syntax for List?
Add
import java.awt.List;to your import statements. This should work fine then.This is mainly because there is a
java.util.Listand ajava.awt.List. Since you are importing both of them using wildcards, the compiler doesn’t know which one you actually want to.