The Core Libraries Group

This Group is comprised of developers who participate in the design, implementation, and maintanence of the Java core libraries.

Introduction

The core libraries consist of classes which are used by many portions of the JDK. The actual set of files has evolved over time, but mostly they include functionality which is close to the VM and is not explicitly included in other areas, such as Security or Networking. Also included are commonly used tools which are either built on top of the core libraries (such as jar) or are used by developers working with them (such as rmic).

Feature Areas

The following table lists the feature areas of the core libraries with their corresponding repository locations and links to other developer documentation. (For documentation targeted for JDK users rather than contributors, see the section End-User Documentation.)

Currently there are some libraries which appear in the name packages as core libraries but are maintained by other groups. These exceptions are mentioned within the corresponding table entries.

Unless otherwise specified, all locations are in the jdk repository.

Feature Area Repository Locations More Information
java.lang

Provides classes that are fundamental to the design of the Java programming language such as String, Math, Enum, and the wrapper classes for primitive types (e.g. Boolean, Float, Character).


src/share/classes/java/lang
src/share/native/java/lang
src/solaris/classes/java/lang
src/solaris/native/java/lang
src/windows/classes/java/lang
src/windows/native/java/lang
test/java/lang

Threading
Includes basic runtime support for threads.


src/share/classes/java/lang/Thread*.java
src/share/native/java/lang/Thread.c
test/java/lang/Thread*

Process
Includes basic runtime support for creating processes and controlling process I/O.


src/share/classes/java/lang/Process.java
src/share/classes/java/lang/ProcessBuilder.java
src/share/classes/java/lang/Runtime.java
src/share/native/java/lang/Runtime.c
src/solaris/classes/java/lang/*Process*
src/windows/classes/java/lang/*Process*
src/solaris/native/java/lang/*Process*
src/windows/native/java/lang/*Process*
test/java/lang/ProcessBuidler
test/java/lang/Runtime
java.lang.annotation javax.annotation

Provides library support for the Java programming language annotation facility. (These are closely related to the Compiler API and javax.lang.model, which are all owned by the Compiler Group.


jdk repository:
src/share/classes/java/lang/annotation
src/share/classes/sun/reflect/annotation
langtools repository:
src/share/classes/javax/annotation src/share/classes/javax/lang/model
  • JSR 269: java.lang.annotation package
  • java.lang.annotation Bugs
  • javax.annotation Bugs
java.lang.instrument

Provides services that allow Java programming language agents to instrument programs running on the JVM. These APIs are owned by the Serviceability Group


src/share/classes/java/lang/instrument
src/share/classes/sun/instrument
src/share/instrument
src/solaris/instrument
src/windows/instrument
test/java/lang/instrument
java.lang.management

Provides the management interface for monitoring and management of the JVM as well as the operating system on which the JVM is running. These APIs are owned by the Serviceability Group


src/share/classes/java/lang/management
test/java/lang/management
java.lang.ref

Provides reference-object classes, which support a limited degree of interaction with the garbage collector.


src/share/classes/java/lang/ref
src/share/native/java/lang/ref
test/java/lang/ref
java.lang.reflect

Provides classes and interfaces for obtaining reflective information about classes and objects.


src/share/classes/java/lang/reflect
src/share/classes/sun/reflect
src/share/native/java/lang/reflect
src/share/native/sun/reflect
test/java/lang/reflect
test/java/lang/Class
java.io

Provides for system input and output and the file system.


src/share/classes/java/io
src/share/native/java/io
src/solaris/classes/java/io
src/solaris/native/java/io
src/windows/classes/java/io
src/windows/native/java/io
test/java/io

Serialization
Supports encoding of objects to and from byte streams.


src/share/classes/java/io/Externalizable.java
src/share/classes/java/io/ObjectInputStream.java
src/share/classes/java/io/ObjectOutputStream.java
src/share/classes/java/io/NotSerializableException.java
src/share/classes/java/io/Serializable.java
src/share/classes/java/io/SerializablePermission.java
src/share/native/java/io/ObjectInputStream.c
src/share/native/java/io/ObjectOutputStream.c
test/java/io/Externalizable
test/java/io/ObjectInputStream
test/java/io/Serializable

serialver
Tool retrieves the serialVersionID for a class.


src/share/classes/sun/tools/serialver
test/java/io/Serializable/serialver
java.nio

Provides buffers to contain data of primitive type.


src/share/classes/java/nio
src/share/classes/sun/nio/ByteBuffered.java
src/share/native/java/nio
src/solaris/native/java/nio
src/windows/native/java/nio
test/java/nio/Buffer
test/java/nio/ByteOrder
test/java/nio/MappedByteBuffer
make/gensrc/GensrcBuffer.gmk
  • JSR 51: java.nio packages for channels and charsets
  • buffer, channels, and file system Bugs
java.nio.channels
java.nio.channels.spi

Defines channels, an abstraction for devices capable of performing I/O operations; defines selectors for multiplexed, non-blocking I/O.


src/share/classes/java/nio/channels
src/share/classes/sun/nio/ch
src/share/native/sun/nio/ch
src/share/sample/nio
src/solaris/classes/sun/nio/ch
src/solaris/native/sun/nio/ch
src/windows/classes/sun/nio/ch
src/windows/native/sun/nio/ch
test/java/nio/channels
test/sun/nio/ch
src/share/sample/nio
 
java.nio.charset
java.nio.charset.spi

Defines charsets, decoders, and encoders, for translating between bytes and Unicode characters


src/share/classes/java/nio/charset
src/share/classes/sun/nio/cs
src/solaris/classes/sun/nio/cs
make/gensrc/GensrcCharsetCoder.gmk

native2ascii
Tool converts files to and from native encodings.


src/share/classes/sun/tools/native2ascii
test/sun/tools/native2ascii
java.nio.file
java.nio.file.attribute
java.nio.file.spi

Defines interfaces and classes to access files, file attributes, and file systems.


src/share/classes/java/nio/file
src/share/classes/com/sun/nio/file
java.util

Provides the collections framework, formatted printing and scanning, array manipulation utilities, event model, date and time facilities, internationalization, and miscellaneous utility classes.


src/share/classes/java/util
test/java/util

Collections
Includes all classes which implement the Collection interface such as data structures implementing lists, queues, maps, and sets.


src/share/classes/java/util/ArrayDeque.java
src/share/classes/java/util/ArrayList.java
src/share/classes/java/util/Collection.java
src/share/classes/java/util/Collections.java
src/share/classes/java/util/*Map.java
src/share/classes/java/util/*Set.java
src/share/classes/java/util/Linked*.java
src/share/classes/java/util/Stack.java
src/share/classes/java/util/Vector.java
test/java/util/ArrayDeque.java
test/java/util/ArrayList.java
test/java/util/Collection.java
test/java/util/Collections.java
test/java/util/*Map.java
test/java/util/*Set.java
test/java/util/Linked*.java
test/java/util/Stack.java
test/java/util/Vector.java

Internationalization Classes
Includes support for internationalization and locale-specific output of dates, times, and currencies. These APIs are owned by the Internationalization Group


src/share/classes/java/util/*Calendar.java
src/share/classes/java/util/Currency.java
src/share/classes/java/util/Date.java
src/share/classes/java/util/Locale*.java
src/share/classes/java/util/ResourceBundle.java
src/share/classes/java/util/*TimeZone*.java
src/share/classes/sun/util/*.java (except PreHashedMap.java)
src/share/classes/sun/util/resources
java.util.concurrent
java.util.concurrent.atomic
java.util.concurrent.locks

Provides utility classes used in concurrent programming, including support for atomic updates of single variables and a locking framework which supplements language-level synchronization.


src/share/classes/java/util/concurrent
src/share/native/java/util/concurrent
test/java/util/concurrent
java.util.jar

Provides classes for reading and writing the JAR (Java ARchive) file format.


src/share/classes/com/sun/java/util/jar
src/share/classes/java/util/jar
src/share/native/com/sun/java/util/jar
test/java/util/jar
Not strictly part of JAR, but useful:
src/share/classes/sun/net/www/protocol/jar
src/solaris/classes/sun/net/www/protocol/jar
src/windows/classes/sun/net/www/protocol/jar
test/sun/net/www/protocol/jar

jar
Tool creates and accesses the contents of a .jar file.


src/share/classes/sun/tools/jar
test/tools/jar

extcheck
Tool detects conflicts between a target .jar file and the currently installed extension .jar files.


src/share/classes/com/sun/tools/extcheck
java.util.logging

Provides support to maintain and service software at customer sites.


src/share/classes/java/util/logging
src/share/classes/sun/util/logging
test/java/util/logging
java.util.regex

Provides classes for matching character sequences against patterns specified by regular expressions.


src/share/classes/java/util/regex
java.util.prefs

Provides classes to store and retrieve user and system preference and configuration data.


src/share/classes/java/util/prefs
src/solaris/classes/java/util/prefs
src/windows/classes/java/util/prefs
java.util.spi

Service provider classes for the java.util package. These APIs are owned by the Internationalization Group


src/share/classes/java/util/spi
java.util.stream

Classes to support function-style operations on streams of elements, such as map-reduce transformations on collections.


src/share/classes/java/util/stream
test/java/util/stream
java.util.zip

Provides classes for reading and writing the standard ZIP and GZIP file formats.


src/share/classes/java/util/zip
src/share/native/java/util/zip
test/java/util/zip
java.math

Provides classes for performing arbitrary-precision integer arithmetic (BigInteger) and arbitrary-precision decimal arithmetic (BigDecimal).


src/share/classes/java/math
src/share/classes/java/lang/Math.java
src/share/classes/java/lang/StrictMath.java
src/share/classes/sun/misc/FloatConsts.java
src/share/classes/sun/misc/FloatingDecimal.java
java.rmi
java.rmi.activation
java.rmi.dgc
java.rmi.registry
java.rmi.server

Provides support for remote communication between programs written in Java.


src/share/classes/java/rmi
src/share/classes/sun/rmi
test/java/rmi
test/sun/rmi

rmic
Tool generates stub, skeleton, and tie classes for remote objects using either the JRMP or IIOP protocols, and generates OMG IDL.


src/share/classes/java/rmi/rmic
test/sun/rmi/rmic

rmid
Tool starts the activation system daemon that allows objects to be registered and activated in a VM.


src/share/classes/com/sun/rmi/rmid

rmiregistry
Tool starts a remote object registry on the specified port on the current host.


src/share/classes/sun/rmi/registry
java.sql
javax.sql

Provides the API for accessing and processing data stored in data source.


src/share/classes/java/sql
src/share/classes/javax/sql
src/share/classes/com/sun/rowset
 
javax.naming
javax.naming.directory
javax.naming.event
javax.naming.ldap
javax.naming.spi

Provides access to Naming and Directory Service such as DNS and LDAP.


src/share/classes/javax/naming
src/share/classes/com/sun/naming
test/javax/naming
src/share/classes/com/sun/jndi
test/com/sun/jndi
javax.script

Provides interfaces and classes that define Java Scripting Engines and a framework for their use in Java applications.

JDK 8 includes source code for the Nashorn script engine which is based on JSR 292's invokedynamic.


jdk repository:
src/share/classes/javax/script
src/share/classes/com/sun/script
src/share/demo/scripting/jconsole.plugin
src/share/sample/scripting
test/javax/script
nashorn repository:
src/*

jrunscript
Tool provides a command line script shell both both interactive and batch modes of script execution.

This tool is experimental and unsupported.


src/share/classes/com/sun/tools/script
test/sun/tools/jrunscript
javax.xml  javax.xml.datatype javax.xml.namespace javax.xml.parsers javax.xml.stream javax.xml.stream.events javax.xml.stream.util javax.xml.transform javax.xml.transform.com javax.xml.transform.sax javax.xml.transform.stax javax.xml.transform.stream javax.xml.validation javax.xml.xpath org.w3c.dom org.w3c.dom.bootstrap org.w3c.dom.ls org.w3c.dom.views org/xml/sax
org/xml/sax.ext
org/xml/sax.helpers

The Java API for XML Processing (JAXP) enables applications to parse, transform, validate, and query XML documents using an API that is independent of a particular XML processor implementation.


jaxp repository:
src/*

Building

Developers are strongly encouraged to perform full builds prior to check-in of any changes. (A full build is a build performed when there is no pre-existing build directory; the respository should contain only the desired changes and no auto-generated data. Simply performing make at the top of the build tree is not a full build.) Depending on the area, incremental builds are not a reliable indicator of whether or not changes will compile successfully in a full build. In particular, some files are used early in the bootstrap phase to build components like java.lang.Object, the launcher, and javac that are used to build the rest of the JDK. These are later re-built once sufficient infrastructure has been generated by the bootstrap build. Incremental builds will only catch errors that occur in the compile after bootstrap.

Even when it appears that only java code is being modified, it is prudent to build on multiple platform families. A recommended minimum is one Windows and one Unix target, but depending on the code being modified, it may be necessary to include a wider spectrum or a specific set of platforms. This is necessary because there is no guarantee that the java code which depends on a change in core is identical on all platforms. For instance, rt.jar is not portable—the classes within it vary from platform to platform.

Testing

Tests or modifications of existing tests are required and must accompany all changes (both new functionality and any bug fixes). There are some exceptions. For example, it is not always possible to provide test for fixes for performance problems or other conditions that are difficult to simulate or require unusual environmental conditions (such as exceptionally low memory, system reboot, third-party software, etc.).

In addition to running the new tests, tests in the modified area and any dependent areas should be run. Dependent areas may not be immediately obvious. As with builds, it is necessary to run tests on multiple platforms.

Not all areas have tests in the repository. There are two possible reasons for this. It may be that there are no tests or tests may exist, but have not been audited for open-sourcing. In the latter case, the goal is to add them soon. Please ask about appropriate testing when considering a modification.

End-User Documentation

The following links reference the canonical end-user documentation for the JDK. The features areas listed above will have documentation in the corresponding sections of these references.

Community