Unable to run ANT target in eclipse getting terminated at beginning and pointing to jdk\bin\javaw.exe

Vishnu picture Vishnu · May 5, 2011 · Viewed 7.4k times · Source

I'm unable to run the ant target in eclipse environment. when i double click on the ant target, it terminating directly and nothing is shown in the console window. and I can see a message at the top of console window as " ProjectName build.xml [ant target] [Ant Build] C:\Programfiles\Java\jdk1.6.0_20\bin\jawa.exe " and nothing is showing in the console window. Can anyone help me please.

Thanks in Advance Vishnu

Answer

Jeshurun picture Jeshurun · Apr 25, 2012

This usually happens if:

  1. You changed the location of eclipse
  2. You changed the location of your jdk / jre
  3. Both

  1. If you changed the location of eclipse, go to Window -> Preferences -> Ant -> Runtime. Under the classpath tab, make sure the ant home entries are correct. If not, carefully locate the folder they are in (they are all in the same folder which is under the eclipse plugins folder) and add them again, then delete the invalid entries.

  2. If you changed the location of your jre / jdk:

    a) Go to Window -> Preferences -> Ant -> Runtime, and under the classpath tab, expand the Global Entries tree. Make sure the location of tools.jar is valid and is located where it says it is in the file system.

    b) Click on Run -> External Tools -> External Tools Configuration. Expand Ant Build, select each of your ant build files in the workspace, then expand the jre tab and make sure that you either have "Run in the same JRE as the workspace" checked, or your Separate JRE points to a valid installed JRE.