Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (3.4k points)
What's the rationale behind the javax package? What goes into java and what into javax?

I know a lot of enterprise-y packages are in javax, but so is Swing, the new date and time api (JSR-310) and other J2SE packages.

1 Answer

0 votes
by (46k points)

I believe it's a traditional thing - if a case is presented as an addition to an existing JRE, it comes in as javax. If it's first presented as part of a JRE (like NIO was, I think) then it appears in as java. Not certain why the new date and time API will end up as javax regarding this logic though... except it will also be prepared individually as a library to work with more primitive versions (which would be useful). Note from many years later: it ended up being in java behind all.

I understand there are limitations on the java package - I think classloaders are set up to just provide classes within java.* to be loaded from rt.jar or something related. (There's absolutely a check-in ClassLoader.preDefineClass.)

Browse Categories

...