@Kuba It may mean that your JRE that you are using for Eclipse (for ant, to be precise), is still Java 6, while in other places Java 8 already is used - or in any case, a mismatch between JRE verisons. Change the JRE to Java 8 (perhaps download and install it, if you don't have it yet), and make sure that the new one is used by ant.
Here is the relevant discussion.