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

  • Home
  • SEARCH
  • 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 8816999
In Process

The Archive Base Latest Questions

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

I am writing a build file for its basic run, clean and compile properties.

  • 0

I am writing a build file for its basic run, clean and compile properties. Here is what I have:

<?xml version="1.0" encoding="ISO-8859-1"?>

<project default="compile">
   <description>
      Compile and run the Java files for Lab7
   </description>

   <target name="prob1" depends='compile'>
      <java classname='prob1'>
         <classpath path='./'/>
         <arg value='Gertrude'/>
         <arg value='Justin'/>
      </java>
   </target>

   <target name="prob2" depends='compile'>
      <java classname='prob2'>
         <classpath path='./'/>
         <arg value='28'/>
      </java>
   </target>

   <target name="prob3" depends='compile'>
      <java classname='prob3'>
         <classpath path='./'/>
         <arg value='2000'/>
      </java>
   </target>

   <target name="prob4" depends='compile'>
      <java classname='prob4'>
         <classpath path='./'/>
         <arg value='2'/>
      </java>
   </target>

  <target name="compile">
    <javac srcdir='./' includeantruntime="false"/>
  </target>

  <target name="clean">
    <delete>
        <fileset dir="./">
            <include name='*.class'/>
        </fileset>
    </delete>
  </target>
</project>

I am trying to run each prob with different arguments one at a time. Like in prob1 i want to run it with the first name then again with the second name, how do I do this?

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

    Yes something like that is possible using antlib, which offers a wide range of functionalities like for loops, if conditions and macros. You can define a macro like

    <macrodef name="call-cc">
       <attribute name="target"/>
       <attribute name="param1">
       <attribute name="param2">
       <element name="yourtask">
          <java classname='$name'>
            <classpath path='./'/>
            <arg value='@{param1}'/>
            <arg value='@{param2}'/>
          </java>
       </element>
    
    </macrodef>
    

    and then you can call it like this

    <call-cc target="unittests" param1="bla" param2="blabla"/>
    

    You can read about antlib in the manual

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

Sidebar

Related Questions

I'm writing an Ant build.xml file for an executable JAR for the first time,
I have couple of bat files which run further files to build the project.
So I have been writing to Environment.SpecialFolder.ApplicationData this data file, that upon uninstall needs
I have the following data in an XML file which i am reading using
I have a string that has 823237 characters in it. its actually an xml
I am making a simple website and am writing a gradle build script that
I am writing a Sublime Text 2 build configuration for grails, which includes a
I am writing some tools for our build system to enforce some strict calling
I'm writing a python program that uses scons to build an .exe and then
I'm writing a simple code generation application to build POCO's from a DB2 database

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.