Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

SV: [jdom-interest] conflicting List class

Per Norrman

2004-01-22

Replies:

Hi,

Visual J++ is a *dead* product that uses Microsofts version of Java 1.1.
The Collection classes (of which java.util.List is one) was introduced
in Java 1.2. Your best bet is to upgrade your development environment:
Eclipse (www.eclipse.org) is a very good IDE, and free!

/pmn


-----Ursprungligt meddelande-----
Från: jdom-interest-admin@(protected)]
För J. Albers
Skickat: den 22 januari 2004 14:21
Till: jdom-interest@(protected)
Ämne: [jdom-interest] conflicting List class


Hi,

This problem has been mentioned a few time, but i didn't find an answer
that could help me. I get the following error message
when compiling the class with the method mentioned below.

- cannot find definition for class 'java.util.List'

The solutions i heard sofar had something to do with java 1.1 versus
java 2.
As far as i know i'm using JDK 1.4 to compile the JDOM package. And i
use Visual J++ for my programm compiling.

Doe anyone know how to solve this?


import java.util.*

private void listElements(Element e)
{
System.out.println("*Element, name:" + e.getName() +
 ", text:" + e.getText()) ;

//List all attributes
List as = e.getAttributes();
for (Iterator i = as.iterator();i.hasNext();)
{
 Attribute a = (Attribute)i.next();
 System.out.println("*Attribute, name:" + a.getName() +
  ", value:" + a.getValue()) ;
}
 
//List all children
List c = e.getChildren();
for (Iterator i = c.iterator();i.hasNext();)
{
 Element n = (Element)i.next();
 listElements(n);
}
}


Thanks, Joachim Albers.

_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.