Will a Java 8 codebase that is compiled with Java 8 work on a Java 6 VM?
Yes, but if you don't make use of features of java 7 and java 8 ...
If the codebase is written using features of newer java versions, then no there's no way to do it!
However, if you want to run them on java 6 you have to set java 6 compliance level(with -source 1.6 -target 1.6 javac parameters) when you compile source code files, to make them compatible with java 6. If you don't set the compliance as shown above, you will get an UnsupportedClassVersionError :
java.lang.UnsupportedClassVersionError:Unsupported major.minor version XX.X
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