EJB specifications and Java versions - backward compatible

This is my understanding of the relationship between the EJB specification and Java versions.

  • EJB 2.0 was part of the J2EE 1.3 platform, which was on top of J2SE 1.3 or JDK 1.3.x
  • EJB 2.1 was part of the J2EE 1.4 platform, which was on top of J2SE 1.4 or JDK 1.4.x

The EJB 2.1 specification requires backward compatibility for EJB 2.0, so containers that support EJB 2.1 and run in JDK 1.4.x will also be able to run EJB 2.0 beans.

  • EJB 3.0 is part of the Java EE 5 platform, which requires Java SE 5 (JDK 5) for annotations, etc.

The EJB 3 specification requires backward compatibility for an earlier version of the specifications.

My question is this. If I update java code to implement EJB 2.0 beans to compile with a later version of Java (like Java 5), ​​can I keep the same version of the EJB specification or do I need to migrate it as well.

+3
source share
2 answers

You don’t even need to β€œupdate” the Java code, since I think that older code can only be incompatible at the source level due to identifiers that run into newly entered keywords, but this is not a problem at the bytecode level.

, Java EAR/EJB 2.0 EAR - Java 5/EJB 3, -target 1.3 JDK (, ).

+4

All Articles