If I understand correctly the binary form of Java 10 is 100% identical to Java 9 so it shouldn't make any problems.
Is my assumption correct?
Java SE 8 is binary-compatible with Java SE 7 except for the incompatibilities listed below. Except for the noted incompatibilities, class files built with the Java SE 7 compiler will run correctly in Java SE 8. Class files built with the Java SE 8 compiler will not run on earlier releases of Java SE.
Backward Compatibility Java versions are expected to be binary backwards-compatible. For example, JDK 8 can run code compiled by JDK 7 or JDK 6. It is common to see applications leverage this backwards compatibility by using components built by different Java version.
It is technically possible to compile Java down to native code ahead-of-time and run the resulting binary. It is also possible to interpret the Java code directly. To summarize, depending on the execution environment, bytecode can be: compiled ahead of time and executed as native code (similar to most C++ compilers)
The java compiler produces one file per class, including for inner classes (anonymous or not). They will always be a .
This has nothing to do with Java 10; the rules are the same as they've always been.
In every version of Java, the classfile version number has been incremented. You can run older classfiles on a newer Java runtime (you can run files compiled twenty years ago under Java 1.0 on Java 10!), but it has never been true that you can run newer classfiles on an older runtime. This hasn't changed with Java 10.
However, you can compile classes such that they run on older versions, if you don't use newer features introduced since that version. This used to be accomplished by the -source
and -target
switches:
// Run this on Java 8
javac -source 6 -target 6 Foo.java
and you'll get classfiles that will run on Java 6 and later. (The source version cannot be greater than the target version.) This was recently replaced with the more comprehensive --release
option:
javac --release 9
which implies not only -source 9
and -target 9
, but the compiler will also prevent you from using JDK functionality introduced after 9.
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