Book Image

OpenJDK Cookbook

Book Image

OpenJDK Cookbook

Overview of this book

Table of Contents (20 chapters)
OpenJDK Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Introduction


OpenJDK is now an official Java 7 reference implementation, and is now one for Java 8 as well. This means that the most essential projects of the Java ecosystem are now open source. This also means that OpenJDK can be installed in various ways—from building from source to installing the binary package from the package manager, if any.

Sun's effort to release an open source JDK was the beginning of the project publicly stated in 2006, during the JavaOne conference. HotSpot was released under the GPLv2 license. The complete source code of the Java Class Library (JCL) was released in May 2007 under the GPL, except for several proprietary parts with GPL-incompatible licenses.

However, some proprietary parts (from 4 to 1 percent of the total code lines, depending on the update number) were required in OpenJDK in a separate proprietary bundle in the OpenJDK 7 b53 update in April 2009.

One may think that the initial installation and configuration are quite simple and do not need some sort of detailed explanation. In many ways, that's true; but there are some difficulties along the way.

We will start by distinguishing OpenJDK from Oracle JDK. The latter is based on the former, but not entirely. Each one has its own advantages and drawbacks. The primary OpenJDK advantage is the fact that it's open source while Oracle JDK is always recommended and is ready-to-use. Besides, OpenJDK 6 is the only maintainable Java 6 realization left, after the Java 6 discontinuation.

Then we will cover the installation process for Windows and possible issues with some Windows versions. After that, we will describe some typical profiles to configure an installed instance of OpenJDK for various needs, such as a server instance and developer instance.

Then we will go in to more complicated matters, such as installing OpenJDK on various Linux systems. There are at least two common ways to do it: the distribution-recommended way that depends on the distribution itself, and another way, which is common for all Linux systems.

Linux configuration is more or less the same as that of Windows, but there are some differences that need to be covered. The differences are, mainly, related to system philosophy, namely the way it's done and then what exactly is done.

Then we will proceed to OpenJDK internal structures—in an introductory way. We will consider OpenJDK projects that are already in use, and will learn how to use instruments that we will need later. Also, we will briefly look at OpenJDK groups and find out what they are doing and how they may influence OpenJDK's further evolution.

Last but not least, you will learn how to benefit from the Adopt OpenJDK program, which is also a part of the OpenJDK community. Adopt OpenJDK is an effort to improve OpenJDK usability readiness, test new language releases, and do whatever it needs to make OpenJDK more useful and welcoming among users as well as developers.

This chapter is written with an introductory purpose, and does not cover some details that are common to Oracle Java. However, it provides a necessary basis to work with.

We will use Java 7, as it is stable and the latest Java version available. All screenshots and processes are assuming that we use Java 7, if another is not explicitly mentioned.

If you already have OpenJDK built and installed as default and you are aware of the differences between OpenJDK and Oracle JDK, as well as of the existence of Adopt OpenJDK, you may skip this chapter entirely.