[jdom-interest] collection error

Ian Lea ian.lea at blackwell.co.uk
Wed Dec 5 02:07:23 PST 2001


JDOM can run with java1.1, with the extra collections package,
or java 1.2+ with the java.util.* collections stuff.  Sounds 
like you should be using the 1.2 version but have built JDOM
for 1.1.  See the file README.txt at the top level of the B7
directory tree (and probably with B6 as well but I don't have
that any more).  Best to use B7 unless there is good reason to
stick with B6.



--
Ian.
ian.lea at blackwell.co.uk


"Sastry, Chellury" wrote:
> 
> Friends,
> 
> I am new to JDOM and I have been using JDOM 6 (with Java 2) in developing
> one of our projects. Is it the case that JDOM 6 uses collections API defined
> in Java 1.1? For example, I import
> 
> java.util.*
> 
> that has the collections API. However, the following code snippet generates
> a run-time classnotfound exception (assume rootElement was define
> somewhere):
> 
> List           elemList = rootElement.getChildren();
> Iterator      elemIt = elemList.iterator();
> 
> while(elemIt.hasNext())
> {
>     // some processing
> }
> 
> However, when I downloaded the 1.1collections package from SUN, and the
> above code snippet is re-written as
> 
> com.sun.java.util.collections.List.List            elemList =
> rootElement.getChildren();
> com.sun.java.util.collections.List.Iterator      elemIt =
> elemList.iterator();
> 
> while(elemIt.hasNext())
> {
>     // some processing
> }
> 
> There is no run-time exception and code runs just fine.
> 
> Does JDOM 7 using the java2 collections define in java.util.*?
> 
> Cheers
> 
> Dr. Chellury R. Sastry
> Member of Technical Staff
> Multimedia and Video Technology Department
> Siemens Corporate Research
> 755 College Road East
> Princeton, NJ 08540
> Tel: (609) 734-3317
> Fax: (609) 734-6565
> e-mail: sastry at scr.siemens.com



More information about the jdom-interest mailing list