Original: http://blog.csdn.net/ooppookid/article/details/51704792
java, javax, org, and Com.sun packages are all class packs provided by JDK and are all in Rt.jar. Rt.jar is the Java base Class library (a very important package in the Java Core framework),
Most of the features include Lang, and Rt.jar default is in the root ClassLoader loading path,
So it is superfluous to put it in classpath. The difference between them is as follows: 1. java.*
Java SE's standard library, as part of the Java standard, is an externally-committed Java development interface that is generally not easily modified to remain backward compatible. The implementation of all JDK, including other manufacturers (IBMJDK/HPJDK/OPENJDK), is the same on java.*. 2. javax.*
It is also part of the Java standard, but is not included in the standard library and is generally part of the standard library extension. Usually belong to a particular domain, not a generic API.
So the API is provided in an extended way to avoid too large a standard library of JDK. Of course, some of the early javax were later incorporated into the standard library, and all should belong to the new version of the JDK's standard library. For example, Jmx,java 5 was previously provided as an extension, but Jdk5 later became part of the standard library, and all javax.management were part of the JDK5 standard library. 3. com.sun.*
is the implementation class for Java.* and javax.* in Sun's hotspot virtual machine. Because it is included in RT, we can also call. But because it is not the interface that Sun is publicly committed to, it can be added or subtracted according to the requirements of the implementation, so it may be different in different versions of the hotspot, and it is not available in other JDK implementations, calling these classes may not be backward compatible, so it is generally not recommended. 4. org.*
is provided by the Enterprise or the organization Java class Library, most is not the Sun company provides, with com.sun.*, does not have the backward compatibility, will add or subtract according to need at any time. The more commonly used are the classes and interfaces of XML, Web pages, and servers provided by the consortium.