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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:15:52+00:00 2026-05-23T09:15:52+00:00

i have a java Swing code in that i need to call an Ant

  • 0

i have a java Swing code in that i need to call an Ant build at run time, here i give my code is it correct way for execution else i will do any changes, i also write my ant build here.While i executing this code there is no output my console still blank, why this problem arise if any solution is there kindly send me..thanks in advance

 Build.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                // TODO Auto-generated method stub

                File buildFile = new File("child_build.xml");
                    Project p = new Project();
                    p.setUserProperty("ant.file", buildFile.getAbsolutePath());     
                    DefaultLogger consoleLogger = new DefaultLogger();
                    consoleLogger.setErrorPrintStream(System.err);
                    consoleLogger.setOutputPrintStream(System.out);
                    consoleLogger.setMessageOutputLevel(Project.MSG_INFO);
                    p.addBuildListener(consoleLogger);

                    try {
                        p.fireBuildStarted();
                        p.init();
                        ProjectHelper helper = ProjectHelper.getProjectHelper();
                        p.addReference("ant.projectHelper", helper);
                        helper.parse(p, buildFile);
                        p.executeTarget(p.getDefaultTarget());
                        p.fireBuildFinished(null);
                    } catch (BuildException e1) {
                        //p.fireBuildFinished(e);
                    }

                }
            }
        });
    }

My ant build is..:

<project basedir="." default="child_build" name="JavaSamp">
    <target name="child_build">
        <mkdir dir="classes" />
        <exec executable="C:\Program Files\Inno Setup 5\ISCC.exe">
            <arg value="${basedir}\Child_Script.iss" />
        </exec>

        <echo message="Child_Script is executed" />
    </target>
</project>
  • 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-23T09:15:53+00:00Added an answer on May 23, 2026 at 9:15 am

    I would have just commented this, but I dont have enough rep to do it. Are you sure you aren’t getting an exception at runtime?

    try {
                        p.fireBuildStarted();
                        p.init();
                        ProjectHelper helper = ProjectHelper.getProjectHelper();
                        p.addReference("ant.projectHelper", helper);
                        helper.parse(p, buildFile);
                        p.executeTarget(p.getDefaultTarget());
                        p.fireBuildFinished(null);
                    } catch (BuildException e1) {
                        //p.fireBuildFinished(e);
                    }
    

    This would swallow BuildExceptions that are being thrown.

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

Sidebar

Related Questions

I have a Java swing application with a panel that contains three JComboBoxe s
Does Java have a built-in way to escape arbitrary text so that it can
Does Java have a data type that represents a period of time eg 34
I have a Java Swing application client that I want to use to consume
I am new to java swing. I have pasted my code below for your
I have a Java web application that has a 'disconnected' Java Swing desktop app.
Say I have the following code: import java.lang.InterruptedException; import javax.swing.SwingWorker; public class Test {
So i have this code that creates a Calculator in Java. But it is
I have a java swing App that connects to a remote Unix box using
I have a pretty complex Java (JDK 6) code that needs to be converted

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.