Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 348193
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T11:20:30+00:00 2026-05-12T11:20:30+00:00

I am trying to build the dom4j JAR, which includes an xml-apis JAR which

  • 0

I am trying to build the dom4j JAR, which includes an xml-apis JAR which contains a DOM API that is older than that shipped with more recent JDKs.

However, even though in the build file the source and target compiler attributes are set to 1.3, and even though the xml-apis JAR is included in the build path, Ant still tries to compile dom4j against another, newer, w3c API (I guess one from a JDK installation).

Here’s the relevant Ant code:

<path id="compile.classpath">
    <fileset dir="./lib/endorsed">
        <include name="*.jar" />
    </fileset>
    <fileset dir="./lib">
        <include name="*.jar" />
    </fileset>
</path>

  <target name="compile" depends="prepare-src">
    <javac srcdir="${build.src}"
           destdir="${build.dest}"
           debug="${debug}"
           optimize="${optimize}"
           target="1.3"
           source="1.3"
           deprecation="${deprecation}"
           classpathref="compile.classpath">
    </javac>
  </target>

the JAR that should be used is in lib/endorsed, but it’s not used during compilation.

How come?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T11:20:31+00:00Added an answer on May 12, 2026 at 11:20 am

    You could modify the boot classpath and there is support for that with a specific attribute in ANT, but I think it should be the java.endorsed.dirs property (in raw javac):

    javac -Djava.endorsed.dirs=/some/path/lib/endorsed ...
    

    Or with a compilerarg ANT sub-element:

    <target name="compile" depends="prepare-src">
        <javac srcdir="${build.src}"
           destdir="${build.dest}"
           debug="${debug}"
           optimize="${optimize}"
           target="1.3"
           source="1.3"
           deprecation="${deprecation}"
           classpathref="compile.classpath">
        <compilerarg value="-Djava.endorsed.dirs=/some/path/lib/endorsed"/>
    </javac>
    

    You shouldn’t add the endorsed directory to the classpath as the boot classpath and any endorsed directories are checked before the classpath to resolve required types. This would mean the JDK’s newer DOM implementation would be found first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to build a plugin effect that will some what look better than this
Im trying to build a html table that only contains the table header and
I'm trying build a method which returns the shortest path from one node to
I have a std::vector< tr1::shared_ptr<mapObject> > that I'm trying build from data contained in
Trying to build the OCaml Win32 API binaries for OCaml 3.11.0 on Win 7
am trying to build a point system which checks how much points a user
Im trying to build a query that will fetch all changed rows from a
I'm trying build a regex that will replace any characters not of the format:
Trying to build a micro-CMS (of sorts), which needs to dish out content i.e.
Im trying to build a feeds application in php in which im using a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.