Ant build will not run in Eclipse

I have Ant build.xml that no longer runs when launched in Eclipse.
I click on Configuring External Tools, select the Ant Build that I ran, and click Run.
Nothing happens - the console window and the assembly do not start (classes do not compile and the WAR file is not created).

I recently added a plugin (Spring IDE), this is the only thing I can think of that has recently changed in my Eclipse configuration.
I can run Ant build fine from the command line.

Can anyone suggest where I could find a mistake?

I am using the Eclipse Helios release, Build id: 20100617-1415 on Windows XP.

+4
source share
3 answers

Today I faced the same problem, the reason for this was the ANT_HOME path variable, explained in other answers.

I originally added ANT_HOME in 2 places listed below and it did not work.

window-> preferences β†’ ant β†’ runtime-> Tab Properties

window-> preferences β†’ ant β†’ runtime-> Classpath tab

But when I delete the Classpath ant tab of the home record (setting it by default using the Restore default option in the lower right settings window), it worked :). So far this is just a surprise for me, because I added the same ant home path in both places.

+3
source

According to pstanton's comment, this symptom will occur if your ANT_HOME folder is incorrectly defined in Eclipse. Eclipse seems to ignore the ANT_HOME system property.

window-> preferences β†’ ant β†’ runtime-> Classpath tab

+2
source

You can check the example in the Apache Ant tutorial .

But you can also try to run the same build.xml Ant files with the Java Launcher with org.apache.tools.ant.Main as the main class.
This will at least prove that your scripts are running in an Eclipse environment.

When you look at Ant Frequently Asked Questions , you also see:

I installed Ant 1.6.x and now I get java.lang.InstantiationException: org.apache.tools.ant.Main

The reason for this is that there is an old version of Ant in the class path or configuration.

Your error message may be hidden in some way, but you should check your class path and see if there is another Ant library there.

+1
source

All Articles