Java Class Library
   HOME

TheInfoList



OR:

The Java Class Library (JCL) is a set of dynamically loadable libraries that Java Virtual Machine (JVM) languages can call at
run time Run(s) or RUN may refer to: Places * Run (island), one of the Banda Islands in Indonesia * Run (stream), a stream in the Dutch province of North Brabant People * Run (rapper), Joseph Simmons, now known as "Reverend Run", from the hip-hop group ...
. Because the
Java Platform Java is a set of computer software and specifications developed by James Gosling at Sun Microsystems, which was later acquired by the Oracle Corporation, that provides a system for developing application software and deploying it in a cro ...
is not dependent on a specific
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
, 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. 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 A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" ...
processing. * The library provides an abstract interface to tasks that would normally depend heavily on the hardware and operating system, such as
network Network, networking and networked may refer to: Science and technology * Network theory, the study of graphs as a representation of relations between discrete objects * Network science, an academic field that studies complex networks Mathematics ...
access and
file File or filing may refer to: Mechanical tools and processes * File (tool), a tool used to ''remove'' fine amounts of material from a workpiece **Filing (metalworking), a material removal process in manufacturing ** Nail file, a tool used to gent ...
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 An operating system (OS) is system software that manages computer hardware, software resources, and provides common services for computer programs. Time-sharing operating systems schedule tasks for efficient use of the system and may also in ...
(such as for I/O or
bitmap graphics upright=1, The Smiley, smiley face in the top left corner is a raster image. When enlarged, individual pixels appear as squares. Enlarging further, each pixel can be analyzed, with their colors constructed through combination of the values for ...
). The classes that give access to these functions commonly use
Java Native Interface In software design, the Java Native Interface (JNI) is a foreign function interface programming framework that enables Java code running in a Java virtual machine (JVM) to call and be called by native applications (programs specific to a hardwa ...
wrappers to access operating system
API An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
s. Almost all of JCL is stored in a single Java archive file called "rt.jar" which is provided with JRE and
JDK The Java Development Kit (JDK) is a distribution of Java Technology by Oracle Corporation. It implements the Java Language Specification (JLS) and the Java Virtual Machine Specification (JVMS) and provides the Standard Edition (SE) of the Java ...
distributions. The Java Class Library (rt.jar) is located in the default bootstrap classpath 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.


Conformance

Any Java implementation must pass the Java
Technology Compatibility Kit A Technology Compatibility Kit (TCK) is a suite of tests that at least nominally checks a particular alleged implementation of a Java Specification Request (JSR) for compliance. It is one of the three required pieces for a ratified JSR in the Java ...
tests for compliance, which includes JCL tests.


Main features

JCL Features are accessed through classes provided in
packages Package may refer to: Containers or Enclosures * Packaging and labeling, enclosing or protecting products * Mail, items larger than a letter * Chip package or chip carrier * Electronic packaging, in electrical engineering * Automotive package, ...
. * contains fundamental classes and interfaces closely tied to the language and
runtime system In computer programming, a runtime system or runtime environment is a sub-system that exists both in the computer where a program is created, as well as in the computers where the program is intended to be run. The name comes from the compile t ...
. * I/O and networking access the platform
file system In computing, file system or filesystem (often abbreviated to fs) is a method and data structure that the operating system uses to control how data is stored and retrieved. Without a file system, data placed in a storage medium would be one larg ...
, and more generally
networks Network, networking and networked may refer to: Science and technology * Network theory, the study of graphs as a representation of relations between discrete objects * Network science, an academic field that studies complex networks Mathematics ...
through the , and packages. For networking,
SCTP The Stream Control Transmission Protocol (SCTP) is a computer networking communications protocol in the transport layer of the Internet protocol suite. Originally intended for Signaling System 7 (SS7) message transport in telecommunication, the p ...
is available through . * Mathematics package: provides mathematical expressions and evaluation, as well as arbitrary-precision decimal and integer number datatypes. *
Collections Collection or Collections may refer to: * Cash collection, the function of an accounts receivable department * Collection (church), money donated by the congregation during a church service * Collection agency, agency to collect cash * Collection ...
and Utilities : built-in Collection
data structure In computer science, a data structure is a data organization, management, and storage format that is usually chosen for efficient access to data. More precisely, a data structure is a collection of data values, the relationships among them, a ...
s, and utility classes, for
Regular expression A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" ...
s, Concurrency,
logging Logging is the process of cutting, processing, and moving trees to a location for transport. It may include skidding, on-site processing, and loading of trees or logs onto trucks or skeleton cars. Logging is the beginning of a supply chain ...
and
Data compression In information theory, data compression, source coding, or bit-rate reduction is the process of encoding information using fewer bits than the original representation. Any particular compression is either lossy or lossless. Lossless compression ...
. *
GUI The GUI ( "UI" by itself is still usually pronounced . or ), graphical user interface, is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, inste ...
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 A widget toolkit, widget library, GUI toolkit, or UX library is a library or a collection of libraries containing a set of graphical control elements (called ''widgets'') used to construct the graphical user interface (GUI) of programs. Most widge ...
, as well as a
Pluggable look and feel Pluggable look and feel is a mechanism used in the Java Swing widget toolkit allowing to change the look and feel of the graphical user interface at runtime. Swing allows an application to specialize the look and feel of widgets by modifying the ...
. It also deals with editable and non-editable text components. * Sound: interfaces and classes for reading, writing,
sequencing In genetics and biochemistry, sequencing means to determine the primary structure (sometimes incorrectly called the primary sequence) of an unbranched biopolymer. Sequencing results in a symbolic linear depiction known as a sequence which succ ...
, 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 Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data. It defines a set of rules for encoding documents in a format that is both human-readable and machine-readable ...
: SAX,
DOM Dom or DOM may refer to: People and fictional characters * Dom (given name), including fictional characters * Dom (surname) * Dom La Nena (born 1989), stage name of Brazilian-born cellist, singer and songwriter Dominique Pinto * Dom people, an et ...
,
StAX Streaming API for XML (StAX) is an application programming interface ( API) to read and write XML documents, originating from the Java programming language community. Traditionally, XML APIs are either: * DOM based - the entire document is read i ...
, XSLT transforms,
XPath XPath (XML Path Language) is an expression language designed to support the query or transformation of XML documents. It was defined by the World Wide Web Consortium (W3C) and can be used to compute values (e.g., strings, numbers, or Boolean v ...
and various APIs for Web services, as SOAP protocol and
JAX-WS The Jakarta XML Web Services (JAX-WS; formerly Java API for XML Web Services) is a Jakarta EE API for creating web services, particularly SOAP services. JAX-WS is one of the Java XML programming APIs. Overview The JAX-WS 2.2 specificatioJSR 2 ...
. * Security is provided by and encryption services are provided by . *
Database In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases sp ...
s: access to SQL databases via * Access to Scripting engines: The package gives access to any conforming
Scripting language A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled. A scripting ...
. *
Applets In computing, an applet is any small application (computing), application that performs one specific task that runs within the scope of a dedicated widget engine or a larger program (computing), program, often as a plug-in (computing), plug-in. T ...
: 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:
java.lang.Class
represents a class, but other classes such as Method and Constructor are available in .


Licensing


Prior licenses

Before the release of OpenJDK, the
JDK The Java Development Kit (JDK) is a distribution of Java Technology by Oracle Corporation. It implements the Java Language Specification (JLS) and the Java Virtual Machine Specification (JVMS) and provides the Standard Edition (SE) of the Java ...
was based on a
proprietary license Proprietary software is computer software, software that is deemed within the free and open-source software to be non-free because its creator, publisher, or other rightsholder or rightsholder partner exercises a legal monopoly afforded by modern ...
. Following their promise to release a fully buildable
JDK The Java Development Kit (JDK) is a distribution of Java Technology by Oracle Corporation. It implements the Java Language Specification (JLS) and the Java Virtual Machine Specification (JVMS) and provides the Standard Edition (SE) of the Java ...
based on almost completely free and open-source code in the first half of 2007, Sun released the complete
source code In computing, source code, or simply code, is any collection of code, with or without comments, written using a human-readable programming language, usually as plain text. The source code of a program is specially designed to facilitate the wo ...
of the Class Library under the
GPL The GNU General Public License (GNU GPL or simply GPL) is a series of widely used free software licenses that guarantee end users the four freedoms to run, study, share, and modify the software. The license was the first copyleft for general u ...
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. 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 The Sun is the star at the center of the Solar System. It is a nearly perfect ball of hot plasma, heated to incandescence by nuclear fusion reactions in its core. The Sun radiates this energy mainly as light, ultraviolet, and infrared radi ...
then
Oracle An oracle is a person or agency considered to provide wise and insightful counsel or prophetic predictions, most notably including precognition of the future, inspired by deities. As such, it is a form of divination. Description The word '' ...
as ''Binary Plugs'' 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, and less than 1% and OpenJDK 6) was: * The
SNMP Simple Network Management Protocol (SNMP) is an Internet Standard protocol for collecting and organizing information about managed devices on IP networks and for modifying that information to change device behaviour. Devices that typically ...
implementation. 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 A software synthesizer or softsynth is a computer program that generates digital audio, usually for music. Computer software that can create sounds or music is not new, but advances in processing speed now allow softsynths to accomplish the sam ...
, became open source. The closed-source software synthesizer has been replaced by a new synthesizer developed specifically for OpenJDK called ''Gervill'', * All
cryptography Cryptography, or cryptology (from grc, , translit=kryptós "hidden, secret"; and ''graphein'', "to write", or ''-logia'', "study", respectively), is the practice and study of techniques for secure communication in the presence of adver ...
classes were released as open-source, * The code that scales and rasterizes
fonts In metal typesetting, a font is a particular size, weight and style of a typeface. Each font is a matched set of type, with a piece (a " sort") for each glyph. A typeface consists of a range of such fonts that shared an overall design. In mod ...
uses open source FreeTypeJava2D project page
/ref> * The native
color management In digital imaging systems, color management (or colour management) is the controlled conversion between the color representations of various devices, such as image scanners, digital cameras, monitors, TV screens, film printers, computer printer ...
uses open-source
LittleCMS Little CMS or LCMS is an open-source color management system, released as a software library for use in other programs which will allow the use of International Color Consortium profiles. It is licensed under the terms of the MIT License. LCMS w ...
. 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. * The
anti-aliasing Anti-aliasing may refer to any of a number of techniques to combat the problems of aliasing in a sampled signal such as a digital image or digital audio recording. Specific topics in anti-aliasing include: * Anti-aliasing filter, a filter used be ...
graphics rasterizer code uses the open source Pisces renderer used in the
phoneME In phonology and linguistics, a phoneme () is a unit of sound that can distinguish one word from another in a particular language. For example, in most dialects of English, with the notable exception of the West Midlands and the north-west o ...
project. * The
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
plugin is open source (the
JavaScript engine A JavaScript engine is a software component that executes JavaScript code. The first JavaScript engines were mere interpreters, but all relevant modern engines use just-in-time compilation for improved performance. JavaScript engines are typica ...
itself was open source from the beginning).


Open source release

Beginning in December 2010, all the so-called ''binary plugs'' were replaced by
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
replacements, making the entire JDK open.


Alternative implementations

GNU Classpath GNU Classpath is a free software implementation of the standard class library for the Java programming language. Most classes from J2SE 1.4 and 5.0 are implemented. Classpath can thus be used to run Java-based applications. GNU Classpath is a p ...
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 Kaffe is a discontinued "clean room design" ( reverse engineering) version of a Java Virtual Machine. It comes with a subset of the Java Platform, Standard Edition (Java SE), Java API, and tools needed to provide a Java runtime environment. Like ...
,
SableVM SableVM was a clean room implementation of Java bytecode interpreter implementing the Java virtual machine ( VM) specification, second edition. SableVM was designed to be a robust, extremely portable, efficient, and fully specifications-compliant ...
,
JamVM JamVM is an open-source Java Virtual Machine (JVM) developed to be extremely small compared with other virtual machines (VMs) while conforming to the Java virtual machine specification version 2 (blue book). JamVM can be configured to use the GNU ...
). Apache Harmony was another free software class library. Its aim was to implement the other parts of the Java stack (
Virtual Machine In computing, a virtual machine (VM) is the virtualization/emulation of a computer system. Virtual machines are based on computer architectures and provide functionality of a physical computer. Their implementations may involve specialized hardw ...
,
Compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
, and other tools required for any Java implementation).


See also

*
Java Platform, Standard Edition Java Platform, Standard Edition (Java SE) is a computing platform for development and deployment of portable code for desktop and server environments. Java SE was formerly known as Java 2 Platform, Standard Edition (J2SE). The platform uses Ja ...
*
List of Java APIs There are two types of Java programming language application programming interfaces (APIs): * The official core Java API, contained in the Android (Google), SE (OpenJDK and Oracle), MicroEJ. These packages (java.* packages) are the core Java la ...
*
OpenJDK OpenJDK (Open Java Development Kit) is a free and open-source implementation of the Java Platform, Standard Edition (Java SE). It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GPL-2.0-only w ...
*
Free Java implementations Free Java implementations are software projects that implement Oracle's Java technologies and are distributed under free software licences, making them free software. Sun released most of its Java source code as free software in May 2007, so it ca ...
*
Standard library In computer programming, a standard library is the library made available across implementations of a programming language. These libraries are conventionally described in programming language specifications; however, contents of a language's as ...
*
Java applet Java applets were small applications written in the Java programming language, or another programming language that compiles to Java bytecode, and delivered to users in the form of Java bytecode. The user launched the Java applet from a ...


References


External links


Java SE Main page
*

* Java software development kits (status ): *
1.7
(early development) *
1.6
(stable, current) *
1.5
(stable) *
1.4
(stable) *
1.3
(obsolete) {{Sun Microsystems Java (programming language) Java (programming language) libraries