what is this ANT build?

73,576

Solution 1

I had the exact same problem, where when I clicked "Run" I would get a menu with options of "Ant Build" or "Ant Build..." -- even though I had a main method.

I finally got my program to run as normal when I copied and pasted my code into a new file in a new project folder. I deleted the old file altogether, along with its source folder.

When I created the new class, I selected the option "Use project folder as root for the sources and class files" instead of creating separate folders.

Then, when I clicked "Run", I got some peculiar output the first time that I didn't understand. The second time, however, I got all my programs running as they used to.

I'm not exactly sure what these actions did to solve the problem, as I, too, am a novice programmer. But I'm getting my information from http://www.daniweb.com/software-development/java/threads/199459/simple-java-applet-wont-run-on-eclipse#.

Hope this helps.

Solution 2

The Java file needs a main method for eclipse to offer you the option to run as a Java application. Otherwise it gives other options such as run on server or run as Ant build and so on.

Solution 3

You can use Ant to build your project, generate docs from inline javadocs, check for coding standard violation, run tests and such. You can use it with a version control system and/or continous integration system together.

Apache Ant
Cruise Control ci system

Solution 4

1.Compiling the code 2.Packaging the binaries 3.Deploying the binaries to the test server 4.Testing the changes 5.Copying the code from one location to another

To automate and simplify the above tasks, Apache Ant is useful. It is an Operating System build and deployment tool that can be executed from the command line.

Solution 5

You don't need an ANT build to test run a simple Java application. Here's what I do:

With the java source file open, click on the down-arrow next to the green run button on the tool bar. Then choose the run button in the drop-down like this:

alt text http://tracyprobst.com/SOImages/EclipseRun1.JPG

There is probably a menu option or function key to get there, but I never learned it.

On the resulting screen, click the button on the top left corner to launch a new configuration. Here you can supply things like arguments or set a special classpath that's different than your project configuration.

Then click the RUN button on the bottom of the dialog and it will run your code. Once you have the run configuration defined, you don't need to define it again for that particular class. The Debug button and Run button are the toolbar share the same run configurations.

Share:
73,576
vas
Author by

vas

Updated on August 09, 2022

Comments

  • vas
    vas over 1 year

    I am new to jav/Eclipse.

    I installed eclipse and working on a JAVA 1.4 file using it as an IDE. I made my code changes and saved it and wanted to Run (cntr F11) or debub (F11) every time i am getting

     select what to run 
               Ant Build 
               Ant Build..
    

    what is this Ant Build ? How to rectify /connect/ Ant Build?

    Ant Build has turned a sort of raod block for me vis a vis running the file. How to Run my file with out getting Ant road blocks?

  • vas
    vas over 14 years
    So do i need to install Ant ? or is there a way it can be run my java file without "Ant Build"?
  • Keegan Crain
    Keegan Crain over 14 years
    you can compile your java file with gcc, or anything else you prefer. Ant is just an excellent tool for you, but not at the level of your knowledge.
  • Alexander Pogrebnyak
    Alexander Pogrebnyak over 14 years
    I think the author is confused with the message s/he is getting from Eclipse IDE.
  • vas
    vas over 14 years
    oh i see ...currently i am using "run/cmd" ...D:/...javac test.java" to execute my java file. This is very tedious so using eclipse how to give /link the "main java method"?