Java Class Library

From HandWiki

The Java Class Library (JCL) is a set of dynamically loadable libraries that Java Virtual Machine (JVM) languages can call at run time. 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.

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.

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.

Main features

Main page: Java Platform, Standard Edition

JCL Features are accessed through classes provided in packages.

Licensing

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,[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), the only part of the Class library that remained proprietary and closed-source (4% (As of May 2007) for OpenJDK 7,[6] and less than 1% (As of May 2008) 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]
  • All cryptography classes were released as open-source,[13]
  • The code that scales and rasterizes fonts uses open source FreeType[14][15][16]
  • 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.
  • The anti-aliasing graphics rasterizer code uses the open source Pisces renderer used in the phoneME project.[15][17][18]
  • The JavaScript plugin is open source (the JavaScript engine itself was open source from the beginning).[19]

Open source release

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).

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

References

  1. "How Classes are Found". Oracle Corporation. http://java.sun.com/javase/6/docs/technotes/tools/findingclasses.html. Retrieved 2015-12-05. 
  2. "JDK Module Summary". Oracle Corporation. 2015-10-23. http://cr.openjdk.java.net/~mr/jigsaw/ea/module-summary.html. Retrieved 2015-11-29. 
  3. http://www.sun.com/software/opensource/java/faq.jsp#b4
  4. Rich Green (2007-05-08). "Open JDK is here!". Sun Microsystems. http://mail.openjdk.java.net/pipermail/announce/2007-May.txt. Retrieved 2011-11-25. 
  5. "OpenJDK Binary Plugs". Sun Microsystems. 2007-05-08. http://openjdk.java.net/legal/binary-plugs-2007-05-08.html. Retrieved 2011-11-25. 
  6. Fitzsimmons, Thomas (2007-05-18). "Plans for OpenJDK". http://fitzsim.org/blog/?p=17. Retrieved 2007-05-22. 
  7. Angel, Lillian (2008-03-13). "OpenJDK to replace IcedTea in Fedora 9". Archived from the original on 2012-12-10. https://archive.today/20121210052442/http://langel.wordpress.com/2008/03/13/openjdk-in-fedora-9/. Retrieved 2008-04-05. 
  8. Wade, Karsten (2008-03-13). "OpenJDK in Fedora 9!". redhatmagazine.com. http://developer.redhatmagazine.com/2008/03/12/openjdk-to-replace-icedtea-in-fedora-9/. 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." 
  9. Herron, David (2007-10-04). "Plans for OpenJDK". Archived from the original on 2007-10-11. https://web.archive.org/web/20071011014156/http://weblogs.java.net/blog/robogeek/archive/2007/10/openjdk_encumbr.html. Retrieved 2007-10-09. 
  10. 10.0 10.1 "OpenJDK 6 b10 source posted". 2008-05-30. http://mail.openjdk.java.net/pipermail/jdk6-dev/2008-May/000058.html. Retrieved 2008-06-01. 
  11. audio-engine project page
  12. "Gervill – Software Synthesizer". https://gervill.dev.java.net/. Retrieved 2008-06-01. 
  13. "Crypto has been added to OpenJDK". 2007-09-27. http://mail.openjdk.java.net/pipermail/security-dev/2007-September/000015.html. Retrieved 2007-10-07. 
  14. font-scaler projectpage
  15. 15.0 15.1 15.2 Java2D project page
  16. "Freetype font rasteriser". 2007-08-07. http://mail.openjdk.java.net/pipermail/font-scaler-dev/2007-August/000011.html. Retrieved 2007-11-24. 
  17. phoneme.dev.java.net/
  18. graphics-rasterizer project page
  19. "Javascript is encumbered and there is no javascript plugin support.". IcedTea. 2008-03-11. http://icedtea.classpath.org/bugzilla/show_bug.cgi?id=85. Retrieved 2008-06-01. "Changing Summary. JavaScript is no longer encumbered, but we still need liveconnect support." 
  20. Kelly O'Hair (December 2010). "OpenJDK7 and OpenJDK6 Binary Plugs Logic Removed". Oracle Corporation. http://mail.openjdk.java.net/pipermail/build-dev/2010-December/003881.html. Retrieved 2011-11-25. 

External links