You are previewing OpenJDK Cookbook.
O'Reilly logo
OpenJDK Cookbook

Book Description

Over 80 recipes to build and extend your very own version of Java platform using OpenJDK project

In Detail

OpenJDK is one of the most widely used open source implementations of the Java platform. It is used to change, customize, and tune core application internals and provide a way to extend the application internals according to your requirements.

OpenJDK Cookbook begins by introducing you to OpenJDK and IcedTea builds for various virtual machine implementations and how to deploy OpenJDK on multiple platforms. Furthermore, the book digs deeper into the development concepts, JVM internals, and techniques to make robust improvements or customizations to OpenJDK. Essentially, the book covers the best practices for accessing and using the core features of OpenJDK to build advanced Java solutions by utilizing the more complex and nuanced parts of OpenJDK.

What You Will Learn

  • Set up a development environment and start hacking OpenJDK

  • Understand advanced features such as adding new intrinsics to JVMs

  • Build different versions of OpenJDK for different operating systems and architectures

  • Write reliable tests using jtreg and get a good understanding of the tool

  • Create and sub limit patches with improvements and bug fixes

  • Understand valuable techniques, native code debugging, and incremental builds

  • Prepare VirtualBox machines with different operating systems

  • Understand the process behind JEPs

  • Downloading the example code for this book. You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

    Table of Contents

    1. OpenJDK Cookbook
      1. Table of Contents
      2. OpenJDK Cookbook
      3. Credits
      4. About the Authors
      5. About the Reviewers
      6. www.PacktPub.com
        1. Support files, eBooks, discount offers, and more
          1. Why subscribe?
          2. Free access for Packt account holders
      7. Preface
        1. What this book covers
        2. What you need for this book
        3. Who this book is for
        4. Sections
          1. Getting ready
          2. How to do it…
          3. How it works…
          4. There's more…
          5. See also
        5. Conventions
        6. Reader feedback
        7. Customer support
          1. Downloading the example code
          2. Errata
          3. Piracy
          4. Questions
      8. 1. Getting Started with OpenJDK
        1. Introduction
        2. Distinguishing OpenJDK from Oracle JDK
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. See also
        3. Installing OpenJDK on Windows
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more...
          5. See also
        4. Configuring OpenJDK on Windows
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more...
        5. Installing OpenJDK on Linux
          1. Getting ready
          2. How to do it...
          3. There's more...
        6. Configuring OpenJDK on Linux
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more...
        7. Navigating through OpenJDK groups and projects
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. See also
      9. 2. Building OpenJDK 6
        1. Introduction
        2. Preparing CA certificates
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Building OpenJDK 6 on Ubuntu Linux 12.04 LTS
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Setting up the minimum build environment for the most compatible Linux builds
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Installing Cygwin for Windows builds
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Building 32-bit FreeType libraries for OpenJDK 6 on Windows
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        7. Building 64-bit FreeType libraries for OpenJDK 6 on Windows
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        8. Building 32-bit OpenJDK 6 on Windows 7 SP1
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        9. Building 64-bit OpenJDK 6 on Windows 7 x64 SP1
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      10. 3. Building OpenJDK 7
        1. Introduction
        2. Building OpenJDK 7 on Ubuntu Linux 12.04 LTS
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Building OpenJDK 7 on Mac OS X
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Building 32-bit FreeType libraries for OpenJDK 7 on Windows
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        5. Building 64-bit FreeType libraries for OpenJDK 7 on Windows
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Building 32-bit OpenJDK 7 on Windows 7 SP1
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        7. Building 64-bit OpenJDK 7 on Windows 7 x64 SP1
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        8. Preparing a standalone toolchain for 32- and 64-bit Windows' builds
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      11. 4. Building OpenJDK 8
        1. Introduction
        2. Working with GNU Autoconf
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Building OpenJDK 8 Ubuntu Linux 12.04 LTS
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Using ccache to speed up the OpenJDK 8 build process
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Building OpenJDK 8 on Mac OS X
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Building OpenJDK 8 on Windows 7 SP1
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      12. 5. Building IcedTea
        1. Introduction
        2. Building IcedTea 6
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Building IcedTea 7
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Building OpenJDK 7 with IcedTea patches
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Building IcedTea 7 with the NSS security provider
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        6. Building IcedTea 6 with the SystemTap support
          1. Getting ready
          2. How to do it...
          3. There's more...
          4. See also
      13. 6. Building IcedTea with Other VM Implementations
        1. Introduction
        2. Configuring cross-compilation between ARM and x86
          1. Getting ready
          2. How to do it...
            1. Configuring OpenEmbedded build manually
            2. Using the Hob utility to configure the OpenEmbedded build
            3. After the build
          3. How it works…
          4. There's more...
            1. Configure problems – when a header file is not found
            2. Fetch problems – where your package is not accessible through any mirror available
            3. Compile problems – where a compile error occurs
            4. Parsing problems – where your recipes cannot be parsed
        3. Building IcedTea for ARM with integrated CACAO VM
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more...
        4. Porting JamVM to use OpenJDK
          1. Getting ready
          2. How to do it...
          3. There's more
        5. Configuring Zero-assembler with the Shark compiler to use OpenJDK
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more
        6. Building for MIPS and other architectures using OpenEmbedded recipes
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more...
      14. 7. Working with WebStart and the Browser Plugin
        1. Introduction
        2. Building the IcedTea browser plugin on Linux
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Using the IcedTea Java WebStart implementation on Linux
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Preparing the IcedTea Java WebStart implementation for Mac OS X
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Preparing the IcedTea Java WebStart implementation for Windows
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      15. 8. Hacking OpenJDK
        1. Introduction
        2. Setting up the development environment with NetBeans
          1. Getting ready
          2. How to do it...
          3. See also
        3. Working with Mercurial forest
          1. Getting ready
          2. How to do it...
          3. How it works…
        4. Understanding OpenJDK 6 and 7 incremental builds
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        5. Debugging Java code using NetBeans
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more...
        6. Debugging C++ code using NetBeans
          1. Getting ready
          2. How to do it...
          3. How it works…
        7. Using NetBeans to compile HotSpot
          1. Getting ready
          2. How to do it...
          3. How it works…
        8. Using HotSpot dev parameters
          1. Getting ready
          2. How to do it...
        9. Adding new intrinsic to HotSpot
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more…
        10. Building VisualVM from the source code
          1. Getting ready
          2. How to do it...
          3. See also
        11. Creating a plugin for VisualVM
          1. Getting ready
          2. How to do it...
          3. See also
        12. Getting benefits from the AdoptOpenJDK project
          1. Getting ready
          2. How to do it...
            1. Visualizing JIT logs
            2. Securing your javadocs
          3. How it works…
          4. There's more...
      16. 9. Testing OpenJDK
        1. Introduction
        2. Running tests using the downloaded or the built version of jtreg
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. See also
        3. Building jtreg from the source
          1. Getting ready
          2. How to do it...
        4. Running the standard set of OpenJDK tests
          1. Getting ready
          2. How to do it...
          3. There's more...
        5. Writing your own test for jtreg
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. See also
        6. Using jtreg in GUI mode
          1. Getting ready
          2. How to do it...
          3. How it works…
        7. Writing TestNG tests for jtreg
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. See also
        8. Compiling JT Harness from the source code
          1. Getting ready
          2. How to do it...
          3. See also
        9. Building and running jcstress
          1. Getting ready
          2. How to do it…
          3. There's more...
        10. Writing tests for jcstress
          1. Getting ready
          2. How to do it…
          3. See also
        11. Creating a benchmark project using JMH
          1. Getting ready
          2. How to do it…
          3. There's more…
          4. See also
        12. Downloading the source and compiling JHM
          1. Getting ready
          2. How to do it…
          3. How it works…
      17. 10. Contributing to OpenJDK
        1. Introduction
        2. Becoming a contributor
          1. Getting ready
          2. How to do it...
          3. See also
        3. Generating a patch with webrev
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. There's more...
          5. See also
        4. Backporting OpenJDK v9 patches to OpenJDK v8
          1. Getting ready
          2. How to do it…
          3. See also
        5. Understanding OpenJDK groups
          1. Getting ready
          2. How to do it…
          3. See also
        6. Understanding OpenJDK projects
          1. How to do it…
          2. See also
        7. Suggesting new JSRs
          1. Getting ready
          2. How to do it...
          3. See also
        8. Suggesting new JEPs
          1. Getting ready
          2. How to do it...
          3. How it works…
          4. See also
      18. 11. Troubleshooting
        1. Introduction
        2. Navigating through the process workflow
          1. Getting ready
          2. How to do it...
          3. How it works…
        3. Submitting a defect to the OpenJDK bug systems
          1. How to do it...
          2. How it works…
        4. Creating a patch using NetBeans
          1. Getting ready
          2. How to do it...
          3. How it works
          4. See also...
        5. Creating a code review
          1. Getting ready
          2. How to do it...
      19. 12. Working with Future Technologies
        1. Introduction
        2. Building OpenJDK 9 on Mac OS X using Clang
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Building OpenJDK 9 on Windows using MSYS
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. See also
        4. Running and testing the early access preview of OpenJDK 9
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        5. Using Jigsaw
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        6. Building OpenJDK 9 with Graal
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
        7. Building OpenJDK 9 with Sumatra
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
      20. 13. Build Automation
        1. Introduction
        2. Installing VirtualBox
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        3. Preparing SSH keys
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        4. Preparing VirtualBox machines with Linux
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        5. Preparing VirtualBox machines with Mac OS X
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        6. Preparing VirtualBox machines with Windows
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        7. Automating builds
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
        8. Building cross-platform installers
          1. Getting ready
          2. How to do it...
          3. How it works...
          4. There's more...
          5. See also
      21. Index