Skip to content

Straightforward use of ant javadoc on JDK25+ - #9701

Merged
jtulach merged 1 commit into
apache:masterfrom
jtulach:jtulach/JavadocOnJdk25
Oct 13, 2026
Merged

jtulach merged 1 commit into
apache:masterfrom
jtulach:jtulach/JavadocOnJdk25

Conversation

@jtulach

@jtulach jtulach commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Problem Description

Generating Javadoc on JDK25+ fails as described on mailing list:

netbeans$ JAVA_HOME=/jdk-25/ ant -q -f ide/projectapi javadoc
Trying to override old definition of task javac
Trying to override old definition of task java
Trying to override old definition of task javadoc
Trying to override old definition of task junit
     [echo] Build number : 20261001-e3c161964007
Trying to override old definition of task custom-javac

BUILD FAILED
/home/devel/NetBeansProjects/netbeans/nbbuild/templates/projectized.xml:409:
The following error occurred while executing this line:
/home/devel/NetBeansProjects/netbeans/nbbuild/javadoctools/links.xml:229:
JAXP00010004: The accumulated size of entities is "100 001" that
exceeded the "100 000" limit set by "jdk.xml.totalEntitySizeLimit".

Workaround

The way this is currently handled is covered in the README at https://github.com/apache/netbeans#generating-javadoc

export ANT_OPTS=-Djdk.xml.totalEntitySizeLimit=200000

as pointed out by @neilcsmith-net

Review the Fix

@matthiasblaesing and @mbien joined the discussion and showed an interest in proper review. Let this PR be a forum for such a review.

@jtulach jtulach self-assigned this Oct 11, 2026
@jtulach jtulach added Ant [ci] enable "build tools" tests build JavaDoc [ci] enable java/javadoc tests and build-javadoc target labels Oct 11, 2026
@mbien

mbien commented Oct 11, 2026

Copy link
Copy Markdown
Member

makes sense overall.

The title is a bit misleading though, given that we already build the javadoc using JDK 25 for NetBeans releases with some of the newer features enabled. Something like "configure parser limits for javadoc target" would be more precise IMO, since the current title would imply that it can't be built on JDK 25 and above right now.

This would also have to remove

* On JDK 24 or later, building javadoc may require to raise the jaxp entity limit by setting `export ANT_OPTS=-Djdk.xml.totalEntitySizeLimit=200000`

and
export ANT_OPTS=-Djdk.xml.totalEntitySizeLimit=200000

with the same commit.

We should do that for jenkins too (probably at https://github.com/apache/netbeans-jenkins-lib/blob/master/vars/asfMainNetBeansBuild.groovy) Eric/Neil know that area better.

@jtulach jtulach changed the title Allow ant javadoc on JDK25+ Straightforward use of ant javadoc on JDK25+ Oct 12, 2026
@jtulach

jtulach commented Oct 12, 2026

Copy link
Copy Markdown
Contributor Author

makes sense overall.

  • thanks
  • title updated to "Straightforward use of ant javadoc on JDK25+"
  • references to the property removed in c27f11b

We should do that for jenkins too (probably at https://github.com/apache/netbeans-jenkins-lib/blob/master/vars/asfMainNetBeansBuild.groovy) Eric/Neil know that area better.

  • I am awaiting instructions, but that would (obviously) be another PR/commit

@neilcsmith-net

Copy link
Copy Markdown
Member

Makes sense overall. Added @ebarboni as reviewer as he's probably done the most work on Javadoc here. Please wait for his input before merging.

Is the naming sysproperty deliberate? Seems confusing with the same named element for other tasks we already have in a bunch of places. I assume it can't conflict?

There seem to be a lot of warnings about the property already being set in the CI, even after removing the environment variable? Is this setting in the right place? I assume the JDK also caches the first value it sees when needed.

We should do that for jenkins too (probably at https://github.com/apache/netbeans-jenkins-lib/blob/master/vars/asfMainNetBeansBuild.groovy) Eric/Neil know that area better.

Could possibly change for master build section. The other sections still have to cover occasional rebuilds on old release branches IIRC.

@ebarboni ebarboni left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM,

it works well with jdk25, it simplify build

PS:
there is a change in jdk26+ that remove jdk.jsobject => java.source.base javadoc are KO but not because of this PR

@matthiasblaesing matthiasblaesing left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. Alternative (more specialized tasks) could be done, but this is small, well readable and solves the problem, so lets keep it. Thank you.

Comment thread nbbuild/default.xml
<taskdef name="subant-junit" classname="org.netbeans.nbbuild.SubAntJUnitReport" classpath="${nbantext.jar}"/>
<taskdef name="resolvelist" classname="org.netbeans.nbbuild.ResolveList" classpath="${nbantext.jar}"/>
<taskdef name="checkmoduleconfigs" classname="org.netbeans.nbbuild.CheckModuleConfigs" classpath="${nbantext.jar}"/>
<taskdef name="sysproperty"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: I think it would be good to follow the formatting convention of the surrounding code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is

    <taskdef name="hgid"
         classname="org.netbeans.nbbuild.HgId"
         classpath="${nbantext.jar}"/>

just few lines above. E.g. there doesn't seem to be a single formatting of these statements.

@jtulach
jtulach force-pushed the jtulach/JavadocOnJdk25 branch from c27f11b to 5ec934e Compare October 12, 2026 19:11
@jtulach
jtulach merged commit 4034611 into apache:master Oct 13, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ant [ci] enable "build tools" tests build JavaDoc [ci] enable java/javadoc tests and build-javadoc target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants