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 9175771
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:58:16+00:00 2026-06-17T16:58:16+00:00

I have a build file that declares the classpath as shown <path id=compile.classpath> <fileset

  • 0

I have a build file that declares the classpath as shown

<path id="compile.classpath">
    <fileset dir="${basedir}/lib"    includes="**"/>        
    <fileset dir="${jboss.home}/lib" includes="**"/>        
    <pathelement path ="${build.classes.dir}"/>
</path>

I tried looking at the documentation but I am not able to understand the use of
pathelement.

I know that the ID is used to refer to this class path while performing a task and fileset includes the jarfiles.

edit 1:
My doubt is Why can’t we use fileset to include the class files in place of pathelement?

  • 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-06-17T16:58:17+00:00Added an answer on June 17, 2026 at 4:58 pm

    Latest edit:

    My doubt is Why can’t we use fileset to include the class files in place of pathelement?

    If you use a fileset then you’d be adding a set of class files to the path as follows:

    CLASSPATH=classes/MyClass1.class:classes/MyClass2.class:classes/MyClass3.class:....
    

    When what Java expects to see is simply:

    CLASSPATH=classes
    

    Only jar (and WAR,EAR,etc) files are explicitly listed on the classpath (Java will open them up and load their class files), hence the need for a fileset in ANT.

    Update

    Here’s the Oracle documentation:

    • http://docs.oracle.com/javase/7/docs/technotes/tools/windows/classpath.html

    Class paths to the .jar, .zip or .class files. Each classpath should end with a filename or directory depending on what you are setting the class path to:

    • For a .jar or .zip file that contains .class files, the class path ends with the name of the .zip or .jar file.
    • For .class files in an unnamed package, the class path ends with the directory that contains the .class files.
    • For .class files in a named package, the class path ends with the directory that contains the “root” package (the first package in the full package name).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ANT build xml file which includes a path declaration with numerous
For example, let's say I have a Maven build file that has dependencies located
We have an underlying .h file in our platform code that needs built differently
I have a master build file which is calling other build.xml files of different
I have a doubt, I made this build file in order to build 3
When you define an extension-point in an Ant build file you can have it
In a build.rake file I have an array holding names of JavaScript files: JS_FROM_INDEX=`./bin/extract_files
I have a dependencies section in my master build.gradle file subprojects { dependencies {
I want to pack the project into a zip-file and have the build date
I have the following defined in a file called build-dependencies.xml <?xml version=1.0 encoding=UTF-8?> <project

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.