You can do this in Run Configuration . Right-click the ant ant file, select Run as → Ant Build... On the JRE tab, you can switch to any JRE.
You may need to add a JRE to eclipse it first by clicking Installed JREs... , after which the Eclipse settings dialog box will open, in which you can add it.
source share