Why should i not use NetBeans and stop worrying about ANT

Posted on 2007-08-11
Last Modified: 2013-11-23
Why do we need Java ant. I know that it incrementally compiles java source code and provides a way for the programmer to define this process in an XML file. I dont know Ant!!!

Why cant i write my application in an Netbeans IDE (which comes with TOMCAT), and let the IDE worry about compiling and running the code, which ever way it wants to. Why do i need Ant then. It adds over learn Ant and write the build process (in XML). The IDE comes with Tomcat which i learnt just now. Since yesterday, i have been spending time dowloading TOMCAT and JavaANT and setting environment variables.. Can any one help me understand why i should not let IDE worry about everything?

and this process does not tell me how to link these separate tools to make a java application
Question by:matu007
    LVL 12

    Accepted Solution

    I'm not a NetBeans expert (I use Eclipse), but I assume it is like Eclipse.  You are correct, the IDE lets you test your application.  Then, when you are ready to deploy the tested app, you can package the app into a jar, war, or ear.  Copy the archive for the app into the proper directory as described here:

    Deploying Web Applications to Tomcat

    We use Ant primarily for two things:
    (1) Local build testing - when I have made some changes, I run all the unit tests to make sure I haven't broken something before I release it.
    (2) Continuous integration - each time changes are released to the team, it is integrated and tested on the development server.  A developer is done with changes once it passes integration testing.  Read more here:

    Choosing a Continuous Integration server

    You don't have to use Ant, especially if you are working alone.  However, a project of any size does need regression and integration tests to be run in an automated environment.  That is where Ant is often used (though the article above gives other alternatives).  These test should be available, since you should be following a test-driven development (TDD) approach IMO.
    LVL 4

    Assisted Solution

    Though you are using NetBeans to build your application, you are actually calling ant to do it.

    Check your file directory in your NetBeans, you should see a file named build.xml.

    This is the default ant build script created for you at the beginning of your project.

    The easiest way to learn ant is to customize this build script.

    :-) Like it or not, you are still using it

    LVL 1

    Expert Comment

    Forced accept.

    EE Admin

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    wordsCount challenge 10 49
    array220 challenge 8 31
    computer science syllabus 3 40
    What is the latest versions eclipse neon 2 59
    Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
    Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
    Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now