Dear List Admin,
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.
As I am not using Java2, I used build11.sh in order to use the
collections.jar file.
I had several problems compiling and have included the changes I made to
the code in order to compile jdom.
Commands run:
./build11.sh clean
- ran fine.
./build11.sh compile
- produced following error output:
JDOM Build System
-------------------
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
Starting Ant...
Buildfile: build.xml
init:
[echo] ----------- JDOM 1.0beta7 [2001] ------------
prepare:
[mkdir] Created dir: /home/nkornwei/jdom/build
prepare-src:
[mkdir] Created dir: /home/nkornwei/jdom/build/src
[mkdir] Created dir: /home/nkornwei/jdom/build/classes
[copy] Copying 44 files to /home/nkornwei/jdom/build/src
collections:
compile:
[javac] Compiling 44 source files to
/home/nkornwei/jdom/build/classes
[javac] /home/nkornwei/jdom/build/src/org/jdom/FilterList.java:64:
Class java.util.ConcurrentModificationException not found in import.
[javac] import java.util.ConcurrentModificationException;
[javac] ^
[javac]
/home/nkornwei/jdom/build/src/org/jdom/ProcessingInstruction.java:60:
Class java.util.ArrayList not found in import.
[javac] import java.util.ArrayList;
[javac] ^
[javac] /home/nkornwei/jdom/build/src/org/jdom/FilterList.java:1445:
Class java.util.ConcurrentModificationException not found in type
declaration.
[javac] throw new ConcurrentModificationException();
[javac] ^
[javac] 3 errors
BUILD FAILED
/home/nkornwei/jdom/build.xml:152: Compile failed, messages should have
been provided.
Work around to resolve: added the following lines to build.xml:
<replace dir="${build.src}" includes="**"
token="java.util.ConcurrentModificationException"
value="${coll.import}.ConcurrentModificationException"/>
<replace dir="${build.src}" includes="**"
token="java.util.ArrayList"
value="${coll.import}.ArrayList"/>
Ran ./build11.sh compile again:
- produced following error output:
...
collections:
compile:
[javac] Compiling 44 source files to
/home/nkornwei/jdom/build/classes
[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.
[javac] AttributeFilter(Element parent) {
[javac] ^
[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.
[javac] AttributeFilter(Element parent) {
[javac] ^
[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.
[javac] AttributeFilter(Element parent) {
[javac] ^
[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.
[javac] ElementContentFilter(Element parent) {
[javac] ^
[javac] 4 errors
BUILD FAILED
/home/nkornwei/jdom/build.xml:156: Compile failed, messages should have
been provided.
Work around to resolve: 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).
The file: src/java/org/jdom/AttributeFilter.java was changed as follows:
AttributeFilter(Element parent) {
// original code.
//this(parent, null, null);
// added:
this.parent = parent;
this.name = null;
this.ns = null;
}
The compile error relating to ElementContentFilter.java is still a
mystery to me....but running the build a second time does not result in
the error message! (...a little unsettling). Any help regarding this
error message would be appreciated.
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!.
Thanks and regards,
Nick Kornweibel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://servlets.com/pipermail/jdom-commits/attachments/20011217/90f95cb8/attachment.htm