[Java Issues] Plugin compatible with many java versions

Dear Forum,
maybe it is an already replied question…but I didnt find a solution, but maybe I am searching bad.
Anyway, I am writing a plugin in Java using Eclipse, my problem is how can I develop a plugin that could be used either with Java 1.6 and with Java 1.8?
By now I was able to develop a plugin for Java 1.8 not compatible with Java 1.6 and viceversa…
Is there a way to develop for both Java environment?
Thank you,

Java 8 is almost 100% backwards compatible with Java 6. So if you develop targeting Java 6, your plugin will be compatible with Java 8 in the vast majority of cases.

Could you elaborate on what went wrong when you targeted Java 6 with your plugin? Why didn’t it work with Java 8? What was the error message, etc.?