2

I have a java application project (ant) under Netbeans and I want to programmatically call the action similar to Netbeans' clean and build (clean the project and than build it) command using something like javac or ant. How am I supposed to do that? I've already look at this but it didn't help me.

4
  • What a clean build differ from a dirty build? Commented Oct 23, 2012 at 9:58
  • Sorry, there was an "and" missing, it's clean and build Commented Oct 23, 2012 at 10:17
  • Downvoter can please tell me the reason? Commented Oct 23, 2012 at 12:12
  • 1
    I'm currently in the home office, and running netbeans over an ssh tunnel is awfully slow. For that reason, an option to start netbeans with a command line parameter to automatically clean and build a given project would be very helpful. Writing the ant script myself, as proposed by Paulius, seems like busywork. Commented Apr 29, 2020 at 12:07

1 Answer 1

1

Netbeans for clean and build is using Ant (If it is not a maven project). Make some research of it (try with Writing a Simple Buildfile) and you will be able to do the same with your project by writing Ant build script for it.

Sign up to request clarification or add additional context in comments.

3 Comments

I already have the build files, I want to run ant using those netbeans created build files
Well, netbeans is generating ant script automatically, so they are IDE dependent. I would not suggest try running or modifying those scripts. Also netbeans generates a lot of crap in those files, you should write them your self, then you'll know what you are doing exactly. To generate ANT scripts automatically is almost the same as to create a web page using FrontPage.
You must be right, I used netbeans' ant-launcher.jar to build my project and it gives error while parsing build files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.