Campbell Ritchie wrote:Would it also make the bytecode impossible to execute on old JVMs? If so, goodbye backward compatibility.
We don't have this anyway--for precisely this reason. Classfiles are versioned, and if you compile something on
Java 8 and try to run it on Java 6, for example, it'll fail. Like this, which comes from hello world compiled with JDK 8 and executed on 7:
Exception in
thread "main" java.lang.UnsupportedClassVersionError: X : Unsupported major.minor version 52.0
But you can still (largely) _compile_ to an older bytecode. Mostly, sometimes, if you don't use the wrong new language features, or libraries...