You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Mukul Gandhi (Jira)" <xe...@xml.apache.org> on 2019/09/05 11:05:00 UTC

[jira] [Comment Edited] (XERCESJ-1707) Unable to build xercesImpl.jar with java 11

    [ https://issues.apache.org/jira/browse/XERCESJ-1707?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16923281#comment-16923281 ] 

Mukul Gandhi edited comment on XERCESJ-1707 at 9/5/19 11:04 AM:
----------------------------------------------------------------

I've been able to find a little bit of resolution about this bug report. I've done my study on XercesJ trunk. Following is what we need to do, to build Xerces when working with JDK 9, 10, 11 or 12 (I've tested with Oracle JDKs for these versions):

1) In the Xerces file XJavac.java (location tools/src), within method definition "public void execute()", comment the entire thing if(isJDK14OrHigher()) { ... }. I feel, due to the main reason being that system property sun.boot.class.path returns null with JDKs 9 and above. After this code change, regenerate the file xjavac.jar using the Ant task xjavac-jar. This shall solve the problem for Xerces builds with Oracle JDKs 9 and above, but I guess Xerces will not build fine when on certain JDKs that the code if(isJDK14OrHigher()) { ... } solves. 

2) In the file build.xml (at the root of source code), in the Ant target <target name="compile" , add org/apache/html/dom/** to excludes of <xjavac ...  This is because, JDKs 9 and above interface signatures are different for many of the JDK interfaces implemented by Xerces classes at location org/apache/html/dom/. Excluding org/apache/html/dom/** from Xerces solves the problem for build with JDK 9 and above, but I imagine Xerces users who depend on the Xerces classes org/apache/html/dom/** won't get this functionality.

I imagine that, an ideal Xerces build solution that utilizes above findings, should conditionally build with JDKs ranging from 1.3 upto 12.


was (Author: mukul_gandhi):
I've been able to find a little bit of resolution about this bug report. I've done my study on XercesJ trunk. Following is what we need to do, to build Xerces when working with JDK 9, 10, 11 or 12 (I've tested with Oracle JDKs for these versions):

1) In the Xerces file XJavac.java (location tools/src), within method definition "public void execute()", comment the entire thing if(isJDK14OrHigher()) { ... }. I feel, due to the main reason being that system property sun.boot.class.path returns null with JDKs 9 and above. This shall solve the problem for Xerces builds with Oracle JDKs 9 and above, but I guess Xerces will not build fine when on certain JDKs that the code if(isJDK14OrHigher()) { ... } solves. 

2) In the file build.xml (at the root of source code), in the Ant target <target name="compile" , add org/apache/html/dom/** to excludes of <xjavac ...  This is because, JDKs 9 and above interface signatures are different for many of the JDK interfaces implemented by Xerces classes at location org/apache/html/dom/. Excluding org/apache/html/dom/** from Xerces solves the problem for build with JDK 9 and above, but I imagine Xerces users who depend on the Xerces classes org/apache/html/dom/** won't get this functionality.

I imagine that, an ideal Xerces build solution that utilizes above findings, should conditionally build with JDKs ranging from 1.3 upto 12.

> Unable to build xercesImpl.jar with java 11
> -------------------------------------------
>
>                 Key: XERCESJ-1707
>                 URL: https://issues.apache.org/jira/browse/XERCESJ-1707
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: Build
>    Affects Versions: 2.12.0
>            Reporter: Thomas Pasch
>            Priority: Major
>
> I'm unable to build xercesImpl.jar with Java 11 even if I set source and target version:
> {{> ant -v -d -Dant.java.version=1.8 clean jar}}
> {{...}}
> {{   [xjavac] Fatal Error: Unable to find package java.lang in classpath or bootclasspath}}
> {{BUILD FAILED}}
> {{/home/tpasch/scm/db-toolchain/submodules/xerces2-j/build.xml:311: Compile failed; see the compiler error output for details.}}
> {{        at org.apache.tools.ant.taskdefs.Javac.compile(Javac.java:1425)}}
> {{        at org.apache.tools.ant.taskdefs.Javac.execute(Javac.java:1133)}}
> {{        at org.apache.xerces.util.XJavac.execute(Unknown Source)}}
> {{        at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)}}
> {{        at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)}}
> {{        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)}}
> {{        at java.base/java.lang.reflect.Method.invoke(Method.java:566)}}
> {{        at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)}}
> {{        at org.apache.tools.ant.Task.perform(Task.java:350)}}
> {{        at org.apache.tools.ant.Target.execute(Target.java:449)}}
> {{        at org.apache.tools.ant.Target.performTasks(Target.java:470)}}
> {{        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)}}
> {{        at org.apache.tools.ant.Project.executeTarget(Project.java:1361)}}
> {{        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)}}
> {{        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)}}
> {{        at org.apache.tools.ant.Main.runBuild(Main.java:834)}}
> {{        at org.apache.tools.ant.Main.startAnt(Main.java:223)}}
> {{        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)}}
> {{        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)}}
> The problem seems to be related to xerces own implementation of java compile, i.e. xjavac.



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

---------------------------------------------------------------------
To unsubscribe, e-mail: j-dev-unsubscribe@xerces.apache.org
For additional commands, e-mail: j-dev-help@xerces.apache.org