Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Web Crawler

Reply
Thread Tools

Web Crawler

 
 
Paul Morrison
Guest
Posts: n/a
 
      10-17-2005
Hi

I got this web crawler from the Sun website
http://java.sun.com/developer/techni...ebCrawler.java,
but when trying to compile it, I get the following errors:

WebCrawler.java:16: reference to List is ambiguous, both class
java.util.List in java.util and class java.awt.List in java.awt match
List listMatches;
^
WebCrawler.java:76: reference to List is ambiguous, both class
java.util.List in java.util and class java.awt.List in java.awt match
listMatches = new List(10);
^
WebCrawler.java:76: java.util.List is abstract; cannot be instantiated
listMatches = new List(10);
^
WebCrawler.java:77: cannot find symbol
symbol : method add(java.lang.String,java.util.List)
location: class java.awt.Panel
panelListCurrent.add("North", listMatches);
^
WebCrawler.java:207: cannot find symbol
symbol : method removeAll()
location: interface java.util.List
listMatches.removeAll();
^

Could this be because I am running a newer version of Java than this was
made of? Ive tried changing the type of listMatches to java.util.List, but
that just creates more problems.

Any help would be much appreciated.

--
Paul


 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      10-17-2005
On Mon, 17 Oct 2005 11:15:12 +0100, "Paul Morrison" <>
wrote or quoted :

>WebCrawler.java:16: reference to List is ambiguous, both class
>java.util.List in java.util and class java.awt.List in java.awt match
> List listMatches;
> ^


sounds like you imported both java.util.List and java.awt.List.

It does not know which one you mean. You have to fully quality it is
either.

java.awt.List listMatches;
or
java.util.List listMatches;

The problem could have come from a general import java.awt.*. Use
Eclipse or other IDE to split that into specific includes.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      10-17-2005
Paul Morrison wrote:
> Hi
>
> I got this web crawler from the Sun website
> http://java.sun.com/developer/techni...ebCrawler.java,
> but when trying to compile it, I get the following errors:
>
> WebCrawler.java:16: reference to List is ambiguous, both class
> java.util.List in java.util and class java.awt.List


What Roedy said (especially about making explicit imports) +
....
> ..Ive tried changing the type of listMatches to java.util.List,


...that's the wrong one. It is after an java.awt.List in that code.

Also, if you're using 1.5, it should show a 'deprecated' warning,
that is because of

'f.show();'

...update that to..

'f.setVisible(true);'

...and the code should be 'OK to go'.

I'm not sure if Roedy mentioned, but he has a wonderful collection
of 'quick help' on all manner of compilation and run time errors
at his site, you can find them LINKED from the bottom of the
section here..
<http://www.physci.org/codes/javafaq.jsp#exact>

...also, a better group for beginner programmers might be..
<http://www.physci.org/codes/javafaq.jsp#cljh>

HTH
 
Reply With Quote
 
lamantpirate lamantpirate is offline
Junior Member
Join Date: Jun 2012
Posts: 1
 
      06-30-2012
Quote:
Originally Posted by Paul Morrison View Post
Hi

I got this web crawler from the Sun website
http://java.sun.com/developer/techni...ebCrawler.java,
but when trying to compile it, I get the following errors:

WebCrawler.java:16: reference to List is ambiguous, both class
java.util.List in java.util and class java.awt.List in java.awt match
List listMatches;
^
WebCrawler.java:76: reference to List is ambiguous, both class
java.util.List in java.util and class java.awt.List in java.awt match
listMatches = new List(10);
^
WebCrawler.java:76: java.util.List is abstract; cannot be instantiated
listMatches = new List(10);
^
WebCrawler.java:77: cannot find symbol
symbol : method add(java.lang.String,java.util.List)
location: class java.awt.Panel
panelListCurrent.add("North", listMatches);
^
WebCrawler.java:207: cannot find symbol
symbol : method removeAll()
location: interface java.util.List
listMatches.removeAll();
^

Could this be because I am running a newer version of Java than this was
made of? Ive tried changing the type of listMatches to java.util.List, but
that just creates more problems.

Any help would be much appreciated.

--
Paul

So, i have the same problem, and i found a little solution :

change this line16 "List listMatches;" with this one : "java.awt.List listMatches;"
and
change the line77 "listMatches = new List(10);" with : "listMatches = new java.awt.List(10);"


thats will work.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
web crawler in python or C? abhinav Python 13 02-20-2006 09:07 PM
Web Crawler Sanjay Patra C++ 2 11-18-2004 06:12 AM
C Web crawler code Sanjay Patra C Programming 1 11-18-2004 04:35 AM
Web Crawler / Spider Commercial Software Info Request Gray Ghost Computer Support 1 11-07-2004 01:48 PM
Web Crawler Hans Computer Support 1 07-20-2003 03:20 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57