Is java bytecode always compatible with conversion?

I understand that the bytecode generated by the JDK X version is guaranteed to run on JVM Y if Y> = X.

Is this supported for all versions of the JDK / JVM? Is it fair to expect class files created by JDK 1 to work in JVM 11?

Refers to JVM Specification , JDK 8 and Java 11 JSR Compatibility Guide Could not find an exact answer.

+4
source share
2 answers

Bytecode should work in future versions. This is still true, but no one knows if this will be true for the whole future.

, API. API , java.lang.NoSuchMethodException .

+4

Java- , JVM . , JVM .

Java- , , . Java 8, invokespecial Java 1.0 . JVM Spec §4.1 :

ACC_SUPER , invokes (§invokespecial), . Java ACC_SUPER. Java SE 8 Java ACC_SUPER class class class.

ACC_SUPER , Java. JDK 1.0.2 access_flags, , ACC_SUPER, , Oracle Java Virtual Machine , .

, Java 1.0 . , invokespecial , .

, jsr ret ¹, , - , . , JVM .


¹ JVM §4.9.1:

class 51.0 , jsr, jsr_w code.

ret , jsr.

+2

Source: https://habr.com/ru/post/1695231/


All Articles