- In Eclipse click Run → External Tools → External Tools Configurations.
- Click the JRE tab.
- Click the Installed JREs… button.
- Click the Add button.
(Select Standard VM, where applicable.) - Click the Directory button.
- Browse to your JDK version (not JRE) of your installed Java
(e.g.C:\Program Files\Java\jdk1.7.0_04). - Click Finish and OK.
- Select the JDK at Separate JRE and click Close.
- Re-run your Ant script — have fun!
This worked in a particular scenario I encountered.