1

I am starting to use java modularity. On java.xml module https://docs.oracle.com/en/java/javase/20/docs/api/java.xml/module-summary.html it is reported as Exports a lot of classes prefixed with javax. WhY ? How it'is possible ? I understood that al java code with javax prefix was ported to jakarta.* , or this is valid only for Jakarta EE distribution and not for JDK ?

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
KronosOne
  • 67
  • 2
  • 8

1 Answers1

2

Jakarta EE versus Java SE

Java SE (Standard Edition) is the regular Java we all know and love, the starting point for Java programming on desktop and server apps. Many of the classes bundled with Java SE use the javax.* package naming. This is true for all versions of Java, through the upcoming Java 21.

Jakarta EE (Enterprise Edition) is a collection of specifications & APIs with various implementations. These run on top of Java SE. These no longer use the javax.* package naming. As of Jakarta 9, these use the jakarta.* package naming. See this Eclipse Newsletter post.

This package naming change is part of the transition due to Oracle Corp donating the former Java EE technologies to the Eclipse Foundation becoming Jakarta EE.

Basil Bourque
  • 303,325
  • 100
  • 852
  • 1,154
  • 1
    The package renaming for Jakarta was done at Oracle's insistence. It is about protecting their Java trademarks, etcetera. – Stephen C Jul 24 '23 at 16:52
  • 1
    @StephenC there might be trademark issues involved, but the idea that two independent parties should not mess around with the same namespace, is straight-forward. – Holger Jul 25 '23 at 11:09
  • @Holger - Yes, sure, separating the namespace is a good idea. But do you think that the Oracle / OpenJDK Java team would have insisted on this *breaking change* for Java EE customers if they didn't have the Oracle lawyers in their ears? (And if yes ... why didn't they do it a lot earlier?) – Stephen C Jul 25 '23 at 13:18
  • @StephenC At least here in the United States, trademark law is tricky and complicated. A key principle is “use it or lose it”, where a trademark holder must actively pursue violators to avoid being considered as having surrendered their rights to the trademark. So of course Oracle’s attorneys would advise against permitting an external organization to use the *Java* trademark on new intellectual property being produced in future versions of Jakarta. … And this topic is not relevant to the technical details covered here on a Stack Overflow page. – Basil Bourque Jul 25 '23 at 16:20
  • 1
    @StephenC what do you mean with “a lot earlier”? Changing the package names only started to make sense after the decision to hand over Java EE to the Apache Foundation, to become Jakarta EE. Also, the technical problems of package name clashes became much more significant after the introduction of the module system in Java 9. – Holger Aug 22 '23 at 14:03