You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Christian Kindler <vo...@gmail.com> on 2011/07/01 18:45:19 UTC

Please my help compile xerces from source

Hello

When I try to compile xerces-sources-2.8.1.jar I catch the following errors:

./org/apache/html/dom/HTMLIFrameElementImpl.java:27:
org.apache.html.dom.HTMLIFrameElementImpl is not abstract and does not
override abstract method getContentDocument() in
org.w3c.dom.html.HTMLIFrameElement
public class HTMLIFrameElementImpl
       ^
./org/apache/html/dom/HTMLFrameElementImpl.java:27:
org.apache.html.dom.HTMLFrameElementImpl is not abstract and does not
override abstract method getContentDocument() in
org.w3c.dom.html.HTMLFrameElement
public class HTMLFrameElementImpl
       ^
./org/apache/html/dom/HTMLObjectElementImpl.java:27:
org.apache.html.dom.HTMLObjectElementImpl is not abstract and does not
override abstract method getContentDocument() in
org.w3c.dom.html.HTMLObjectElement
public class HTMLObjectElementImpl
       ^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
3 errors

How can I get around this?

I am on a 64 Bit CentOS Linux using the oracle java 1.5 compiler
$ORACLE_HOME/jdk/bin/javac -version
javac 1.5.0_17
javac: no source files
Usage: javac <options> <source files>

and this is my compile sctript <compile.sh>:
#!/bin/bash

#add priviously compiled jars to cp
echo ../bin/`ls ../bin/` | sed -e's/\s/:\.\.\/bin\//g' > /tmp/jars
CP=`cat /tmp/jars`

export JAVA_HOME=$ORACLE_HOME/jdk
export CLASSPATH="$CP"

BCP="$ORACLE_HOME/jdk/jre/lib/rt.jar:$ORACLE_HOME/jdk/lib/tools.jar"
echo $CLASSPATH
echo `pwd`

find -name "*.java" > source;
echo $ORACLE_HOME/jdk/bin/javac -source 1.5 -nowarn -classpath "$CP"
-J-Xms256m -J-Xmx256m @source
$ORACLE_HOME/jdk/bin/javac -source 1.5 -nowarn  -J-Xms256m -J-Xmx256m
@source

Thank you very much
Christian Maier

Re: Please my help compile xerces from source

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hi Leigh,

I wasn't aware of that issue. The build script / tools sometimes need
tweaking for new Java versions. Perhaps something in build.xml or elsewhere
needs to be updated to allow the compile to work with Java 7.

Thanks.

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org

Leigh L Klotz Jr <le...@xerox.com> wrote on 08/02/2011 07:06:54 PM:

> Michael,
>
> This is an offlist comment about
> http://www.mail-archive.com/j-users@xerces.apache.org/msg03454.html as
> I'm not subscribed.
> This same error happens if you use JDK 1.7 and the included build script.
> JDK 1.6 is fine.
>
> Leigh.

Re: Please my help compile xerces from source

Posted by Michael Glavassevich <mr...@ca.ibm.com>.
Hello Christian,

Christian Kindler <vo...@gmail.com> wrote on 07/01/2011 12:45:19 PM:

> Hello
>
> When I try to compile xerces-sources-2.8.1.jar I catch the following
errors:

We don't distribute such a jar. I'm not sure where you got this from.

> ./org/apache/html/dom/HTMLIFrameElementImpl.java:27:
> org.apache.html.dom.HTMLIFrameElementImpl is not abstract and does
> not override abstract method getContentDocument() in
> org.w3c.dom.html.HTMLIFrameElement
> public class HTMLIFrameElementImpl
>        ^
> ./org/apache/html/dom/HTMLFrameElementImpl.java:27:
> org.apache.html.dom.HTMLFrameElementImpl is not abstract and does
> not override abstract method getContentDocument() in
> org.w3c.dom.html.HTMLFrameElement
> public class HTMLFrameElementImpl
>        ^
> ./org/apache/html/dom/HTMLObjectElementImpl.java:27:
> org.apache.html.dom.HTMLObjectElementImpl is not abstract and does
> not override abstract method getContentDocument() in
> org.w3c.dom.html.HTMLObjectElement
> public class HTMLObjectElementImpl
>        ^
> Note: Some input files use or override a deprecated API.
> Note: Recompile with -Xlint:deprecation for details.
> Note: Some input files use unchecked or unsafe operations.
> Note: Recompile with -Xlint:unchecked for details.
> 3 errors

This is a problem with your classpath. Some JDKs contain a level of the DOM
HTML APIs which are incompatible with the official version from the W3C.
Special care needs to be taken when compiling to avoid this conflict.

> How can I get around this?

I would suggest that you follow this FAQ [1]. You should have a much easier
time compiling the source if you use Xerces' build scripts. With build.sh
you only need to set JAVA_HOME. It takes care of the classpath setup.

> I am on a 64 Bit CentOS Linux using the oracle java 1.5 compiler
> $ORACLE_HOME/jdk/bin/javac -version
> javac 1.5.0_17
> javac: no source files
> Usage: javac <options> <source files>
>
> and this is my compile sctript <compile.sh>:
> #!/bin/bash
>
> #add priviously compiled jars to cp
> echo ../bin/`ls ../bin/` | sed -e's/\s/:\.\.\/bin\//g' > /tmp/jars
> CP=`cat /tmp/jars`
>
> export JAVA_HOME=$ORACLE_HOME/jdk
> export CLASSPATH="$CP"
>
> BCP="$ORACLE_HOME/jdk/jre/lib/rt.jar:$ORACLE_HOME/jdk/lib/tools.jar"
> echo $CLASSPATH
> echo `pwd`
>
> find -name "*.java" > source;
> echo $ORACLE_HOME/jdk/bin/javac -source 1.5 -nowarn -classpath "$CP"
> -J-Xms256m -J-Xmx256m @source
> $ORACLE_HOME/jdk/bin/javac -source 1.5 -nowarn  -J-Xms256m -J-Xmx256m
@source
>
> Thank you very much
> Christian Maier

Thanks.

[1] http://xerces.apache.org/xerces2-j/faq-build.html#faq-2

Michael Glavassevich
XML Parser Development
IBM Toronto Lab
E-mail: mrglavas@ca.ibm.com
E-mail: mrglavas@apache.org