Java Class Library Explained
The Java Class Library (JCL) is a set of dynamically loadable libraries that Java Virtual Machine (JVM) languages can call at run time. It is the standard library of Java and other JVM languages, and is thus sometimes called the Java Standard Library.[1] Because the Java Platform is not dependent on a specific operating system, applications cannot rely on any of the platform-native libraries. Instead, the Java Platform provides a comprehensive set of standard class libraries, containing the functions common to modern operating systems. Since Java 9, the Java Class Library can be accessed through module path using the Java Platform Module System.
JCL serves three purposes within the JVM:
- Like other standard code libraries, they provide the programmer a well-known set of useful facilities, such as container classes and regular expression processing.
- 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.
It uses the namespaces java.*, javax.*, and jdk.*. Some bundled classes may reside in namespaces like sun.* or com.sun.* (for Sun Microsystems), but they are not considered part of the standard library. The javax namespace was primarily associated with Java Platform, Enterprise Edition as extension packages to the Java standard library.
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), which are instead written in C++.[2] 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 "" which is provided with JRE and JDK distributions. The Java Class Library is located in the default bootstrap classpath[3] 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 "" JAR file and modularized the JCL itself in several modules with specified dependencies.[4]
Conformance
Any Java implementation must pass the Java Technology Compatibility Kit tests for compliance, which includes JCL tests.
Main features
See main article: Java Platform, Standard Edition. JCL Features are accessed through classes provided in packages.
- contains fundamental classes and interfaces closely tied to the language and runtime system.
- I/O and networking access the platform file system, and more generally networks through the, and packages. For networking, SCTP is available through .
- Mathematics package: provides mathematical expressions and evaluation, as well as arbitrary-precision decimal and integer number datatypes.
- Collections and Utilities : built-in Collection data structures, and utility classes, for regular expressions, concurrency, logging and data compression.
- GUI and 2D Graphics: the AWT package basic GUI operations and binds to the underlying native system. It also contains the 2D Graphics API. The Swing package 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: deals with text, dates, numbers and messages.
- Image package: and provide APIs to write, read, and modify images.
- XML: SAX, DOM, StAX, XSLT transforms, XPath and various APIs for Web services, as SOAP protocol and JAX-WS.
- Security is provided by and encryption services are provided by .
- Databases: access to SQL databases via
- Access to Scripting engines: The package gives access to any conforming Scripting language.
- Applets: allows applications to be downloaded over a network and run within a guarded sandbox
- Java Beans: provides ways to manipulate reusable components.
- Introspection and reflection: represents a class, but other classes such as Method and Constructor are available in .
Packages outside of the main namespace
Java bundles some packages outside of the main namespaces (java.*, javax.*, and jdk.*). Among these include:
Implementation packages
The sun.* (which contains the sun.misc.Unsafe class, used to manipulate the CPU and hardware, directly manage memory, and other things)[10] and com.sun.* packages are all part of a module called jdk.unsupported.[11] This module contains packages not part of the Java standard library but bundled as part of the Java implementation.
Licensing
See also: Free Java implementations and OpenJDK.
Prior licenses
Before the release of OpenJDK, the JDK was based on a proprietary license.
Following their promise to release a fully buildable JDK based on almost completely free and open-source code in the first half of 2007,[12] 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.[13] 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[14] which were required to build the JDK but not necessary to run it., the only part of the Class library that remained proprietary and closed-source (4% for OpenJDK 7,[15] and less than 1% and OpenJDK 6[16] [17]) was[18] the SNMP implementation.[19]
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:
Open source release
Beginning in December 2010, all the so-called binary plugs were replaced by open source replacements, making the entire JDK open.[29]
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).
Apache Harmony was another free software class library. Its aim was to implement the other parts of the Java stack (Virtual Machine, Compiler, and other tools required for any Java implementation).
See also
External links
Notes and References
- Huisman, M. . Jacobs, B. P. F. . van den Berg, J. . 1999 . A case study in class library verification: Java's vector class . FernUniversität . 40 . 6 October 2025 .
- Web site: Based on the OpenJDK sources. 23 October 2021. OpenJDK.
- Web site: How Classes are Found . . 2015-12-05 . 2009-04-25 . https://web.archive.org/web/20090425152829/http://java.sun.com/javase/6/docs/technotes/tools/findingclasses.html . live .
- Web site: JDK Module Summary . . 2015-10-23 . 2015-11-29 . 2015-12-08 . https://web.archive.org/web/20151208074800/http://cr.openjdk.java.net/~mr/jigsaw/ea/module-summary.html . dead.
- Web site: netspace.javascript (Java SE 25 & JDK 25). 10 October 2025. docs.oracle.com. Oracle Corporation.
- Web site: org.ietf.jgss (Java SE 25 & JDK 25). 10 October 2025. docs.oracle.com. Oracle Corporation.
- Web site: java.corba (Java SE 10 & JDK 10). docs.oracle.com. 10 October 2025. Oracle Corporation.
- Web site: org.w3c.dom (Java SE 25 & JDK 25). 10 October 2025. docs.oracle.com. Oracle Corporation.
- Web site: org.xml.sax (Java SE 25 & JDK 25). 10 October 2025. docs.oracle.com. Oracle Corporation.
- Web site: The Unsafe Class: Unsafe at Any Speed. blogs.oracle.com. Ben Evans. 4 May 2020. Oracle Corporation.
- Web site: jdk.unsupported. OpenJDK. cr.openjdk.org. 10 October 2025.
- Web site: May 2007 . Free and Open Source Java - FAQ . dead . https://web.archive.org/web/20070522170749/http://www.sun.com/software/opensource/java/faq.jsp#b4 . May 22, 2007 . 2024-06-27 . sun.com . en.
- Web site: Open JDK is here! . Rich Green . . 2007-05-08 . 2011-11-25 . 2012-02-07 . https://web.archive.org/web/20120207052347/http://mail.openjdk.java.net/pipermail/announce/2007-May.txt . live .
- Web site: OpenJDK Binary Plugs . . 2007-05-08 . 2011-11-25 . https://web.archive.org/web/20120826021741/http://openjdk.java.net/legal/binary-plugs-2007-05-08.html . 2012-08-26 . dead.
- Web site: Plans for OpenJDK . Fitzsimmons. Thomas . 2007-05-18 . 2007-05-22.
- Web site: OpenJDK to replace IcedTea in Fedora 9 . Angel . Lillian . 2008-03-13 . 2008-04-05 . dead . https://archive.today/20121210052442/http://langel.wordpress.com/2008/03/13/openjdk-in-fedora-9/ . 2012-12-10.
- Web site: OpenJDK in Fedora 9! . Wade . Karsten . redhatmagazine.com . 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. . 2008-03-13 . 2008-04-05 . https://web.archive.org/web/20080421100346/http://developer.redhatmagazine.com/2008/03/12/openjdk-to-replace-icedtea-in-fedora-9/ . 2008-04-21 . dead.
- Web site: Plans for OpenJDK . Herron . David . 2007-10-04 . 2007-10-09 . dead . https://web.archive.org/web/20071011014156/http://weblogs.java.net/blog/robogeek/archive/2007/10/openjdk_encumbr.html . 2007-10-11.
- Web site: OpenJDK 6 b10 source posted . 2008-05-30 . 2008-06-01 . 2009-06-18 . https://web.archive.org/web/20090618054843/http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-May/000058.html . live .
- Web site: audio-engine project page . 2007-05-19 . 2007-05-16 . https://web.archive.org/web/20070516132340/http://openjdk.java.net/projects/audio-engine/ . live .
- Web site: Gervill – Software Synthesizer . https://archive.today/20111004052704/https://gervill.dev.java.net/ . dead . 2011-10-04 . 2008-06-01.
- Web site: Crypto has been added to OpenJDK . 2007-09-27 . 2007-10-07 . 2007-12-25 . https://web.archive.org/web/20071225035137/http://mail.openjdk.java.net/pipermail/security-dev/2007-September/000015.html . live .
- Web site: font-scaler projectpage . 2007-05-19 . 2015-06-10 . https://web.archive.org/web/20150610021721/http://openjdk.java.net/projects/font-scaler/ . live .
- Web site: Java2D project page . 2007-05-19 . 2007-05-16 . https://web.archive.org/web/20070516132229/http://openjdk.java.net/groups/2d/ . live .
- Web site: Freetype font rasteriser . 2007-08-07 . 2007-11-24 . 2009-01-07 . https://web.archive.org/web/20090107195849/http://mail.openjdk.java.net/pipermail/font-scaler-dev/2007-August/000011.html . live .
- Web site: phoneme.dev.java.net/ Welcome to the PhoneME project . https://web.archive.org/web/20070610234355/https://phoneme.dev.java.net/ . 2007-06-10.
- Web site: graphics-rasterizer project page . 2007-05-19 . 2007-05-16 . https://web.archive.org/web/20070516132602/http://openjdk.java.net/projects/graphics-rasterizer/ . live .
- Web site: Javascript is encumbered and there is no javascript plugin support. . . Changing Summary. JavaScript is no longer encumbered, but we still need liveconnect support. . 2008-03-11 . 2008-06-01 . 2008-09-27 . https://web.archive.org/web/20080927185957/http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=85 . dead.
- Web site: OpenJDK7 and OpenJDK6 Binary Plugs Logic Removed . Kelly O'Hair . . December 2010 . 2011-11-25 . 2022-04-07 . https://web.archive.org/web/20220407115622/http://mail.openjdk.java.net/pipermail/build-dev/2010-December/003881.html . live .