Let's say I'm using an older version of java (pre java 8) in a project. Can I use a jar library which was compiled using java 8 in this project? What complications could arise if I try to do that? How can I resolve them?
An Older Java runtime environment will not understand Java 8 specific features, so running your Java 8 code on Older Java JRE is not going to work.
If you tried to use the JAR compiled in JAVA 8 in your older JAVA version, then you will come across the "Major-Minor Version" issue.
If the jar was compiled using -target 1.7 (or lower) then the Java 7 JRE will be able to use it, but then the author of the jar cannot use language features that only work on Java 8 or newer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With