I have a jar file in that some features only belong to java 8
(for ex lambda expression), so it is compiled in java 8
. Same jar has some features belong to both java 7
and java 8
. Now i want that when user run this jar in java 7
, java 7
related classes should work as he/she only wants functionality that work on java 7
only. If he/she wants the functionality related to java 8 , he will run it with java 8
.
This java 8
compiled jar should not give an error of "Lambda expressions are allowed only at source level 1.8 or above". And i don't want to create separate jars for java 8
and java 7
users.