xdoclet and jdk1.3

Kyle VanderBeek kylev-bsdjava at kylev.com
Fri Mar 26 12:09:55 PST 2004


On Thu, Mar 25, 2004 at 10:28:47AM -0800, Kyle VanderBeek wrote:
> On Thu, Mar 25, 2004 at 11:19:12AM +0200, Alexey Zelkin wrote:
> > Sometimes this problem appears then compiled code expects to be executed
> > under jdk1.4.  Try it first.
> 
> Thanks for the hint.  First I'm going to try to compile my own XDoclet
> .jars under the 1.3 VM and see what happens when using them.  Hopefully 
> it's just a mistake on the part of the XDoclet release manager, using a 
> 1.4 JDK.

For the sake of google, and other seekers of knowledge, I'll post my 
solution.  It does looks like xjavadoc was compiled under a 1.4 SDK, but 
has no (real) reason to be.  I managed to create my own 1.3.1-compiled 
xjavadoc .jar, and replaced the one in my expanded xdoclet lib 
directory.  Now, using xdoclet under ant works on my BSD machines.

The machine is FreeBSD 4.9-RELEASE-p1 with java 1.3.1p8.

Since it is non trivial, I'll post what I did here:

1) Check out the xjavadoc 1.0.2 version, which is what xdoclet-1.2 
comes with:

cvs -z3 -d :pserver:anonymous at cvs.sourceforge.net:/cvsroot/xdoclet export -r XJAVADOC_1_0_2  xjavadoc

2) Edit the build.xml so that the "jar" target depends on "compile"  
instead of "junit".  Else you have to make junit work in ant.  Why there 
isn't a regular non-test compile method in xjavadoc is beyond me.

3) Build with javac 1.3.1, adding xalan and xerces as transformer and 
XML tools respectively.  You have to do this because 1.3.1 doesn't come 
with this built in (1.4 does).  All one line:

ANT_OPTS="-cp 
/home/kylev/cvswork/is/3rd_party/java/xerces-2_5_0/xercesImpl.jar:lib/xalan.jar 
-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl 
-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl 
-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl" 
ant

4) Enjoy the glory of a non-sucking target/xjavadoc-1.0.2.jar !  Drop it 
in place in your xdoclet-1.2/lib directory, and hack away.

-- 
kylev at kylev.com
  Some people have a way with words, while others... erm... thingy.



More information about the freebsd-java mailing list