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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:10:13+00:00 2026-06-14T04:10:13+00:00

I recently started to learn ant and have ran into some trouble, i basically

  • 0

I recently started to learn ant and have ran into some trouble, i basically have 2 packages and am trying to compile both, but both packages consist of java files which depend on each other(e.g. a.java from package1 is dependent on b.java from package2 and vice versa) hence i cant compile one with out the other for example below.

<?xml version="1.0"?>
  <project name="exampleproject" basedir="." default="compile">
  <property name="src1" value="package1"/>    
  <property name="src2" value="package2"/> 
  <property name="dest" value="build"/>
  <property name="classpath" value="${dest}"/>
<target name="clean">
    <delete dir="${dest}"/>
</target>
<target name="build" depends="clean">
    <mkdir dir="${dest}"/>
</target>
<target name="compile" depends="clean,build">
      <javac srcdir="${src1}" destdir="${dest}"
         classpath="${classpath}"
         includeantruntime="false">
       </javac>
       <javac srcdir="${src2}" destdir="${dest}"
         classpath="${classpath}"
         includeantruntime="false">
       </javac>
</target>
</project>

From testing this does not work as when a try to compile package1 the build fails as there are classes in package2 yet not compiled, the only solution i have is to restructure my program, anybody have any better ideas on how to solve this problem?

Thanks.

  • 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-14T04:10:14+00:00Added an answer on June 14, 2026 at 4:10 am

    According to http://ant.apache.org/manual/Tasks/javac.html:

    javac’s srcdir, classpath, sourcepath, bootclasspath, and extdirs
    attributes are path-like structures and can also be set via nested
    (note the different name!), , ,
    and elements, respectively

    So you can use

      <javac destdir="${dest}" classpath="${classpath}" includeantruntime="false">
        <src path="${src1}"/>
        <src path="${src2}"/>
      </javac>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have recently started to learn C# and have some questions regarding properties.
I've recently started to learn Fluent NH, and I'm having some trouble with this
I have recently started trying to learn MPI to code in C. I am
I recently started to learn how to use openCL to speed up some part
I have recently started to learn Objective-C and write my tests using OCUnit that
I'm recently started to learn Twisted framework and now looking for some cheat sheets/reference
I have a friend and he recently started to learn Cinema 4D. He asked
When I started to learn about WPF and MVVM recently, I came across some
Sorry if this is a simple question, but I've only recently started learn coding
I have recently started a tutorial to learn how to code GUI using Windows

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.