The library provides an abstract interface to tasks that would normally depend heavily on the hardware and operating system, such as network access and file access.
Some underlying platforms may not support all of the features a Java application expects. In these cases, the library implementation can either emulate those features or provide a consistent way to check for the presence of a specific feature.
Implementation and configuration
JCL is almost entirely written in Java, except for the parts that need direct access to the hardware and operating system (such as for I/O or bitmap graphics). The classes that give access to these functions commonly use Java Native Interface wrappers to access operating system APIs.
Almost all of JCL is stored in a single Java archive file called "rt.jar" which is provided with JRE and JDK distributions. The Java Class Library (rt.jar) is located in the default bootstrap classpath[1] and does not have to appear in the classpath declared for the application. The runtime uses the bootstrap class loader to find the JCL.
The Java Module System (part of the Java 9 release) broke the monolithic "rt.jar" JAR file and modularized the JCL itself in several modules with specified dependencies.[2]
Conformance
Any Java implementation must pass the Java Technology Compatibility Kit tests for compliance, which includes JCL tests.
GUI and 2D Graphics: the AWT package (java.awt) basic GUI operations and binds to the underlying native system. It also contains the 2D Graphics API. The Swing package (javax.swing) is built on AWT and provides a platform-independent widget toolkit, as well as a pluggable look and feel. It also deals with editable and non-editable text components.
Sound: interfaces and classes for reading, writing, sequencing, and synthesizing of sound data.
Text: java.text deals with text, dates, numbers and messages.
Following their promise to release a fully buildable JDK based on almost completely free and open-source code in the first half of 2007,[3] Sun released the complete source code of the Class Library under the GPL on May 8, 2007, except some limited parts that were licensed by Sun from third parties who did not want their code to be released under an open-source license.[4] Sun's goal was to replace the parts that remain proprietary and closed source with alternative implementations and make the Class Library completely free and open source.
Until December 2010, the remaining encumbered part of the JDK was made available by Sun then Oracle as Binary Plugs[5] which were required to build the JDK but not necessary to run it. as of May 2007[update], the only part of the Class library that remained proprietary and closed-source (4% as of May 2007[update] for OpenJDK 7,[6] and less than 1% as of May 2008[update] and OpenJDK 6[7][8]) was[9] the SNMP implementation.[10]
Since the first May 2007 release, Sun, with the help of the community, released as open-source or replaced with open-source alternatives almost all the encumbered code:
All the audio engine code, including the software synthesizer, became open source.[10][11] The closed-source software synthesizer has been replaced by a new synthesizer developed specifically for OpenJDK called Gervill,[12]
The native color management uses open-source LittleCMS.[15] There is a pluggable layer in the JDK, so that the commercial release of Java can use the original, proprietary color management system and OpenJDK can use LittleCMS.
Beginning in December 2010, all the so-called binary plugs were replaced by open source replacements, making the entire JDK open.[20]
Alternative implementations
GNU Classpath is the other main free software class library for Java. Contrary to other implementations, it only implements the Class Library, and is used by many free Java runtimes (like Kaffe, SableVM, JamVM).
^Wade, Karsten (2008-03-13). "OpenJDK in Fedora 9!". redhatmagazine.com. Archived from the original on 2008-04-21. Retrieved 2008-04-05. Thomas Fitzsimmons updated the Fedora 9 release notes source pages to reflect that Fedora 9 would ship with OpenJDK 6 instead of the IcedTea implementation of OpenJDK 7. Fedora 9 (Sulphur) is due to release in May 2008.