<HTML>
Dear List Admin,
<P>I have today (17th December 2001) downloaded the latest source
for JDom and compiled it on a Solaris (SunOS 5.6) server using Java
1.1.8.
<P>As I am not using Java2, I used <B>build11.sh </B>in order
to use the collections.jar file.
<P>I had several problems compiling and have included the changes I made
to the code in order to compile jdom.
<P><U>Commands run:</U>
<P><B>./build11.sh clean</B>
<BR> - ran fine.
<BR><B>./build11.sh compile</B>
<BR> - produced following error output:
<P><FONT SIZE=-1>JDOM Build System</FONT>
<BR><FONT SIZE=-1>-------------------</FONT><FONT SIZE=-1></FONT>
<P><FONT SIZE=-1>Building with classpath /home/javad/jdkSunOS-1.1.8/lib/tools.jar:./lib/xerces.jar:./lib/ant.jar:./lib/jaxp.jar:/home/javad/jdkSunOS-1.1.8/lib/dev.jar:/home/javad/jdkSunOS-1.1.8/lib/classes.zip:/home/javad/jdkSunOS-1.1.8/lib/rt.jar:./lib/collections.jar</FONT><FONT SIZE=-1></FONT>
<P><FONT SIZE=-1>Starting Ant...</FONT><FONT SIZE=-1></FONT>
<P><FONT SIZE=-1>Buildfile: build.xml</FONT><FONT SIZE=-1></FONT>
<P><FONT SIZE=-1>init:</FONT>
<BR><FONT SIZE=-1> [echo] ----------- JDOM 1.0beta7
[2001] ------------</FONT><FONT SIZE=-1></FONT>
<P><FONT SIZE=-1>prepare:</FONT>
<BR><FONT SIZE=-1> [mkdir] Created dir: /home/nkornwei/jdom/build</FONT><FONT SIZE=-1></FONT>
<P><FONT SIZE=-1>prepare-src:</FONT>
<BR><FONT SIZE=-1> [mkdir] Created dir: /home/nkornwei/jdom/build/src</FONT>
<BR><FONT SIZE=-1> [mkdir] Created dir: /home/nkornwei/jdom/build/classes</FONT>
<BR><FONT SIZE=-1> [copy] Copying 44 files to /home/nkornwei/jdom/build/src</FONT><FONT SIZE=-1></FONT>
<P><FONT SIZE=-1>collections:</FONT><FONT SIZE=-1></FONT>
<P><FONT SIZE=-1>compile:</FONT>
<BR><FONT SIZE=-1> [javac] Compiling 44 source files
to /home/nkornwei/jdom/build/classes</FONT>
<BR><FONT SIZE=-1> [javac] /home/nkornwei/jdom/build/src/org/jdom/FilterList.java:64:
Class java.util.ConcurrentModificationException not found in import.</FONT>
<BR><FONT SIZE=-1> [javac] import java.util.ConcurrentModificationException;</FONT>
<BR><FONT SIZE=-1> [javac]
^</FONT>
<BR><FONT SIZE=-1> [javac] /home/nkornwei/jdom/build/src/org/jdom/ProcessingInstruction.java:60:
Class java.util.ArrayList not found in import.</FONT>
<BR><FONT SIZE=-1> [javac] import java.util.ArrayList;</FONT>
<BR><FONT SIZE=-1> [javac]
^</FONT>
<BR><FONT SIZE=-1> [javac] /home/nkornwei/jdom/build/src/org/jdom/FilterList.java:1445:
Class java.util.ConcurrentModificationException not found in type declaration.</FONT>
<BR><FONT SIZE=-1> [javac]
throw new ConcurrentModificationException();</FONT>
<BR><FONT SIZE=-1> [javac]
^</FONT>
<BR><FONT SIZE=-1> [javac] 3 errors</FONT><FONT SIZE=-1></FONT>
<P><FONT SIZE=-1>BUILD FAILED</FONT><FONT SIZE=-1></FONT>
<P><FONT SIZE=-1>/home/nkornwei/jdom/build.xml:152: Compile failed, messages
should have been provided.</FONT>
<P><U>Work around to resolve:</U> added the following lines to <B>build.xml:</B><B></B>
<P> <replace dir="${build.src}" includes="**"
<BR>
token="java.util.ConcurrentModificationException" value="${coll.import}.ConcurrentModificationException"/>
<BR> <replace dir="${build.src}" includes="**"
<BR>
token="java.util.ArrayList" value="${coll.import}.ArrayList"/><B></B>
<P><U>Ran ./build11.sh compile again:</U>
<P> - produced following error output:
<BR>...
<BR><FONT SIZE=-1>collections:</FONT><FONT SIZE=-1></FONT>
<P><FONT SIZE=-1>compile:</FONT>
<BR><FONT SIZE=-1> [javac] Compiling 44 source files
to /home/nkornwei/jdom/build/classes</FONT>
<BR><FONT SIZE=-1> [javac] /home/nkornwei/jdom/build/src/org/jdom/AttributeFilter.java:89:
Blank final variable 'parent' may not have been initialized. It must be
assigned a value in an initializer, or in every constructor.</FONT>
<BR><FONT SIZE=-1> [javac] AttributeFilter(Element
parent) {</FONT>
<BR><FONT SIZE=-1> [javac] ^</FONT>
<BR><FONT SIZE=-1> [javac] /home/nkornwei/jdom/build/src/org/jdom/AttributeFilter.java:89:
Blank final variable 'ns' may not have been initialized. It must be assigned
a value in an initializer, or in every constructor.</FONT>
<BR><FONT SIZE=-1> [javac] AttributeFilter(Element
parent) {</FONT>
<BR><FONT SIZE=-1> [javac] ^</FONT>
<BR><FONT SIZE=-1> [javac] /home/nkornwei/jdom/build/src/org/jdom/AttributeFilter.java:89:
Blank final variable 'name' may not have been initialized. It must be assigned
a value in an initializer, or in every constructor.</FONT>
<BR><FONT SIZE=-1> [javac] AttributeFilter(Element
parent) {</FONT>
<BR><FONT SIZE=-1> [javac] ^</FONT>
<BR><FONT SIZE=-1> [javac] /home/nkornwei/jdom/build/src/org/jdom/ElementContentFilter.java:82:
Blank final variable 'parent' may not have been initialized. It must be
assigned a value in an initializer, or in every constructor.</FONT>
<BR><FONT SIZE=-1> [javac] ElementContentFilter(Element
parent) {</FONT>
<BR><FONT SIZE=-1> [javac] ^</FONT>
<BR><FONT SIZE=-1> [javac] 4 errors</FONT><FONT SIZE=-1></FONT>
<P><FONT SIZE=-1>BUILD FAILED</FONT><FONT SIZE=-1></FONT>
<P><FONT SIZE=-1>/home/nkornwei/jdom/build.xml:156: Compile failed, messages
should have been provided.</FONT>
<P><U>Work around to resolve: </U>this is a known compiler bug with 1.1.x
Java compilers (to my knowledge). The code must be restructured so that
final members are initialized directly in all constructors (rather than
through a call to another constructor).
<BR>The file: <B>src/java/org/jdom/AttributeFilter.java</B> was changed
as follows:
<P> AttributeFilter(Element parent) {
<BR> // original code.
<BR> //this(parent, null, null);
<BR> // added:
<BR> this.parent = parent;
<BR> this.name =
null;
<BR> this.ns
= null;
<BR> }
<P>The compile error relating to ElementContentFilter.java is still a mystery
to me....but running the build a second time <I>does not result in the
error message! </I>(...a little unsettling). Any help regarding this error
message would be appreciated.
<P>Hope the above is clear enough to be of some use. I suspect I am having
these problems either because I am one of the few users still with
Java 1.1.x, or I am doing something wrong!.
<P>Thanks and regards,
<P>Nick Kornweibel
<BR>
<BR> </HTML>