- Java Class Library
The Java Class Library is a set of dynamically loadable libraries that Java applications can call at
runtime . Because theJava Platform is not dependent on any specific operating system, applications cannot rely on any of the existing libraries. Instead, the Java Platform provides a comprehensive set of standard class libraries, containing much of the same reusable functions commonly found in modern operating systems.The Java class libraries serve three purposes within the Java Platform:
* Like other standard code libraries, they provide the programmer a well-known set of functions to perform common tasks, such as maintaining lists of items or performing complex string parsing.
* In addition, the class libraries provide an abstract interface to tasks that would normally depend heavily on the hardware and operating system. Tasks such as network access and file access are often heavily dependent on the native capabilities of the platform.
* Finally, some underlying platforms may not support all of the features a Java application expects. In these cases, the class libraries can either emulate those features using whatever is available, or provide a consistent way to check for the presence of a specific feature.Architecture
The Java Class Library is almost entirely written in Java itself, except the parts that need to have direct access to the
hardware andoperating system (as for I/O, or GraphicRasterisation ). The Java classes that give access to these functions commonly use JNI wrappers to access the native API of the operating system.Mostly all the Java classes of the library are contained in a single Jar file contained in the JRE or JDK distribution, called "rt.jar". Contrary to other libraries used by an application, the Class Library contained in "rt.jar" is in the default Bootstrap Classpath [ [http://java.sun.com/javase/6/docs/technotes/tools/findingclasses.html How Classes are Found] ] , and so does not have to be included in the Classpath declared for the application.
Conformance
Any Java implementation must pass the Java
Technology Compatibility Kit tests for compliance.Main Features
Features of the Class Library are accessed through classes grouped by packages.
* contains fundamental classes and interfaces closely tied to the language and runtime system.
* I/O and networking: access to the platformfile system , and more generally to networks, is provided through the Javadoc:SE|package=java.io|java/io, Javadoc:SE|package=java.nio|java/nio, and Javadoc:SE|package=java.net|java/net packages.
* Mathematics package: Javadoc:SE|package=java.math|java/math provides regular mathematical expressions, as well as arbitrary-precision decimals and integers numbers.
* Collections and Utilities : provide built-in Collection data structures, and various utility classes, forRegular expression s, Concurrency, logging andData compression .
*GUI and 2D Graphics: the Javadoc:SE|package=java.awt|java/awt package supports basic GUI operations and binds to the underlying native system. It also contains the 2D Graphics API. The Javadoc:SE|package=javax.swing|javax/swing package is built on AWT and provides a platform independentwidget toolkit , as well as aPluggable look and feel . It also deals with editable and non-editable text components.
* Sound: provides interfaces and classes for reading, writing, sequencing, and synthesizing of sound data.
* Text: the Javadoc:SE|package=java.text|java/text package deals with text, dates, numbers, and messages.
* Image package: Javadoc:SE|package=java.awt.image|java/awt/image and Javadoc:SE|package=javax.imageio|javax/imageio provide APIs to write, read, and modify images.
*XML : built-in classes handle SAX, DOM,StAX , XSLT transforms,XPath , and various APIs for Web services, as SOAP protocol and JAX-WS.
* CORBA and RMI APIs, including a built-in ORB
* Security and Cryptography
*Database s: access toSQL databases is provided through the Javadoc:SE|package=java.sql|java/sql package.
* Access to Scripting engines: the Javadoc:SE|package=javax.script|javax/script package gives access anyScripting language that conforms to this API.
* Applets: Javadoc:SE|package=java.applet|java/applet allows applications to be downloaded over a network and run within a guarded sandbox
* Java Beans: Javadoc:SE|package=java.beans|java/beans provides ways to manipulate reusable components.Licensing
Following their promise to release a fully buildable JDK based almost completely on free and open source code in the first half of
2007 [http://www.sun.com/software/opensource/java/faq.jsp#b4] , Sun released the completesource code of the Class Library under theGPL onMay 8 ,2007 , except some limited parts that were licensed by Sun from third parties who did not want their code to be released under a free and open-source license. [cite web
url=http://mail.openjdk.java.net/pipermail/announce/2007-May.txt
title=Open JDK is here!
publisher=Sun Microsystems
date=2007-05-08
accessdate=2007-05-09] Sun's goal is to replace the parts that remain proprietary and closed source with alternative implementations and make the Class Library completely free and open source. [Since there's some encumbered code in the JDK, Sun will continue to use that code in commercial releases until it is replaced by fully-functional free and open-source alternatives.]As of May 2008, the only part of the Class library that remain proprietary and closed-source (4% as of May 2007 for OpenJDK 7 [cite web
url=http://fitzsim.org/blog/?p=17
title=Plans for OpenJDK
last=Fitzsimmons|first=Thomas
date=2007-05-18
accessdate=2007-05-22] , and less than 1% as of May 2008 and OpenJDK 6cite web
url=http://langel.wordpress.com/2008/03/13/openjdk-in-fedora-9/
title=OpenJDK to replace IcedTea in Fedora 9
last=Angel|first=Lillian
date=2008-03-13
accessdate=2008-04-05] cite web
url=http://developer.redhatmagazine.com/2008/03/12/openjdk-to-replace-icedtea-in-fedora-9/
title=OpenJDK in Fedora 9!
last=Wade|first=Karsten
publisher=redhatmagazine.com
quote="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."
date=2008-03-13
accessdate=2008-04-05] ) is [cite web
url=http://weblogs.java.net/blog/robogeek/archive/2007/10/openjdk_encumbr.html
title=Plans for OpenJDK
last=Herron|first=David
date=2007-10-04
accessdate=2007-10-09] cite web
url=http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-May/000058.html
title=OpenJDK 6 b10 source posted
date=2008-05-30
accessdate=2008-06-01] :
* The SNMP implementation.Since the first May 2007 release,
Sun Microsystems , with the help of the community, has released as Open-source or replaced with Open-source alternatives almost all the encumbered code:
* All the audio engine code, including the software synthetizer, has been released as Open-source [ [http://openjdk.java.net/projects/audio-engine/ audio-engine project page] ] . The closed-source software synthesizer has been replaced by a new synthesizer developed specifically for OpenJDK called "Gervill" [cite web
url=https://gervill.dev.java.net/
title=Gervill - Software Synthesizer
accessdate=2008-06-01] ,
* Allcryptography classes used in the Class library have been released as Open-source [cite web
url=http://mail.openjdk.java.net/pipermail/security-dev/2007-September/000015.html
title=Crypto has been added to OpenJDK
date=2007-09-27
accessdate=2007-10-07] ,
* The code that scales and rasterizes fonts has been replaced byFreeType [ [http://openjdk.java.net/projects/font-scaler/ font-scaler projectpage] ] [http://openjdk.java.net/groups/2d/ Java2D project page] ] [cite web
url=http://mail.openjdk.java.net/pipermail/font-scaler-dev/2007-August/000011.html
title=Freetype font rasteriser
date=2007-08-07
accessdate=2007-11-24]
* The nativecolor management system has been replaced byLittleCMS . There is a pluggable layer in the JDK, so that the commercial version can use the old color management system and OpenJDK can use LittleCMS.
* Theanti-aliasing graphics rasterizer code has been replaced by the Open-sourced Pisces renderer used in thephoneME project [ [https://phoneme.dev.java.net/ phoneme.dev.java.net/] ] [ [http://openjdk.java.net/projects/graphics-rasterizer/ graphics-rasterizer project page] ] . This code is fully functional, but still needs some performance enhancements [cite web
url=http://mail.openjdk.java.net/pipermail/2d-dev/2007-October/000078.html
title=Open Source rasterizer
publisher=Sun Microsystems
last=Graham|first=Jim
date=2007-10-03
accessdate=2007-05-09] ,
* TheJavascript plugin has been open-sourced (the JavaScript engine itself was open-sourced from the beginning) [cite web
url=http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=85
title=Javascript is encumbered and there is no javascript plugin support.
publisher=IcedTea
quote="Changing Summary. JavaScript is no longer encumbered, but we still need liveconnect support."
date=2008-03-11
accessdate=2008-06-01] .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 (likeKaffe ,SableVM ,JamVM ,CACAO ).Apache Harmony is another free software class library. Its aim is to also implement the other parts of the Java stack (Virtual Machine, Compiler, and other tools required for any Java implementation).References
ee also
*
Java Platform, Standard Edition
*List of Java APIs
*OpenJDK
*Free Java implementations
*Standard library External links
* [http://java.sun.com/j2se/ Java SE Main page]
*
* [http://java.sun.com/reference/api/index.html Java SE API documentation]
* Java software development kits (status as of August 2006):
** [https://jdk7.dev.java.net/ 1.7] (early development)
** [http://java.sun.com/javase/6/ 1.6] (stable, current)
** [http://java.sun.com/j2se/1.5.0/ 1.5] (stable)
** [http://java.sun.com/j2se/1.4.2/ 1.4] (stable)
** [http://java.sun.com/j2se/1.3/ 1.3] (obsolete)
Wikimedia Foundation. 2010.