I have a project that is run by customers using a Java 7 runtime.
I added a dependency in an artifact that compiles against Java 8 - uses Java 8 features, like lambdas and streams.
When compiling my project, I don't get any error that something is wrong.
In runtime though, I get a bunch of error, not recognizing stuff, obviously.
Is there a way to protect my project from using artifact depending on higher level Java? Thanks.
* This is a general question for an artifact depending on some low level Java API that tries to add a dependency on another artifact that depends on higher level Java.
* I guess this is because Java is not part of the explicit dependency definition but rather implicit. The question is how to make it more explicit and protected.