I have a project that uses java compliance 1.6 and I use jre8 to eclipse.
Eclipse prevents me from using java 7 & 8 syntax (like try with resources), however it does not prevent me from using java 7 or 8 classes (like java.util.Objects) .
Is there any way I can force eclipse to show an error if I accidentally use a class from a newer java version than the project's compliance level?
Edit: I have also noted that changing the execution environment to 1.6 does not help either. The only way around it is to include jre6 separately. Is that missing from Eclipse or is it done on purpose?
I know how to use a different compliance level. My question is why changing the compliance of a specific project not enough without using an older jre.