iTranslated by AI

The content below is an AI-generated translation. This is an experimental feature, and may contain errors. View original article
🖊️

I Became an OpenJDK Author: A Detailed Walkthrough

に公開

Introduction

Hello, everyone. I'm Peyang.
I usually love Java and JVM-related technologies, and I spend my days playing around with the JVM's internals and the Java language. It's been a while since my last update, but that's because I've been playing with Java.
Here's my previous article:

https://zenn.dev/peyang/articles/making-jvm-knowledges

By the way, I recently became an Author in the OpenJDK JDK project, so I'd like to explain how to contribute to OpenJDK and share some interesting stories about the Java ecosystem based on that experience.

OpenJDK Account
(I've covered my personal info with a seaweed bento to prevent identification)

Interesting Facts About Java

The Java ecosystem is a very interesting thing. Originally, Java originated from Sun Microsystems, but currently, Oracle is leading it.
The primary implementation of Java is developed in an open-source project called OpenJDK, which serves as the official reference implementation of the JDK and plays a central role in the evolution of the language specification and the introduction of new features.
This community-driven development system of OpenJDK is an important foundation that supports Java's growth and adaptation to various platforms.

Java's Contributors

OpenJDK is an open community, and many companies and individuals, including Oracle, collaborate on it.
The following chart shows the number of issues fixed from JDK 11 to JDK 25, broken down by organization.

OpenJDK's Major Contributors
Source: Issues fixed in JDK 11-JDK 25 per organization, Sharat Chander, 2025-09, The Arrival of Java 25

As you can see from this image, Oracle (in red) contributes the most, but notable companies such as Red Hat, Microsoft, and Amazon also contribute heavily.
What's noteworthy is the orange section in the upper right corner, which shows contributions from individuals.
This demonstrates that contributions to OpenJDK come not only from developers within companies but also from individual developers.

So, you see that individuals can contribute as well, but the specific methods and know-how are not widely known.
Therefore, this article explains how to contribute to OpenJDK and the process of becoming an Author.

OpenJDK Community Overview

To contribute to OpenJDK, you first need to understand the community overview.

OpenJDK is divided into several major projects.
The main projects are as follows:

  • JDK: The project that develops the JDK itself.
  • Loom: The project that introduces lightweight threads (virtual threads).
  • Panama: The project that improves interoperability between Java and native code (C/C++).
  • Amber: The project that explores new language features through JEPs (Java Enhancement Proposals).

Additionally, there is a project called Duke aimed at managing Java's mascot character.

Roles in OpenJDK

The OpenJDK community has several roles that are valid within each project.

  1. Contributor: A person who proposes changes to code or documentation. This refers to anyone who has signed the OCA (Oracle Contributor Agreement), described later, or belongs to an organization that has done so.
  2. Author: Among Contributors, a person who has had two or more patches approved and integrated into a specific project. This is the first role that aspiring contributors to OpenJDK aim for.
  3. Committer: Among Authors, a person who is trusted further and has the ability to commit directly to the project's repository. You can apply once eight or more patches have been approved and integrated.
  4. Reviewer: Among Committers, a person who has gained even higher trust. They have the authority to review proposed changes and approve or reject them. Applying requires 32 high-quality patches.

Becoming an Author is relatively easy (compared to other roles). After two or more patches are approved, you can apply by email to the project lead, and it will be mechanically approved.
On the other hand, becoming a Committer or Reviewer requires evaluation of not only the number of patches but also their quality and appropriateness, making the bar higher. Moreover, the application requires recommendations from existing Committers or Reviewers, and a vote on the mailing list is also conducted.

How to Contribute to OpenJDK

Now, let's get into the main topic: how to contribute to OpenJDK. Here, among the various ways to contribute, we will focus on proposing code changes.

1. Sign the OCA (Oracle Contributor Agreement)

The very first thing you should do is sign the OCA (Oracle Contributor Agreement).
The OCA is a legal agreement for Oracle to accept contributions to OpenJDK. By signing it, you agree to the following:

  • The contributed patch (code or documentation) will be published under the OpenJDK license (GPLv2 + Classpath Exception).
  • The contributed patch may be used and modified by Oracle and the OpenJDK community.
  • Oracle may incorporate the contributed patch into commercial products.
  • You transfer intellectual property rights related to the contributed patch to Oracle.
    (and others)

When you go to the OCA signing page, you will be presented with two options:
OCA signing page

  • Sign a Company Agreement: Choose this if you belong to a company and that company claims intellectual property rights. Basically, the company signs the OCA, and then you sign as a member of that company.
  • Sign an Individual Agreement: Choose this if you are signing as an individual. You need to enter personal information such as your name, email address, and physical address.

For students or individual developers, you typically choose "Sign an Individual Agreement."

After signing the OCA, an Oracle representative will verify it, and within a few days the status will be updated to "Approved."
OCA approved screen

2. Join the OpenJDK Mailing Lists

While waiting for OCA approval, join the OpenJDK mailing lists.
Since OpenJDK development and discussions are mainly conducted through mailing lists, joining them is very important.
Each project has its own dedicated mailing list, so join the list for the project you want to contribute to.

The list of mailing lists is here.

If you want to contribute to JDK, it's good to join announce, jdk-dev, core-libs-dev, etc.
Fill in the form with your email address and submit it; you will receive a confirmation email. Click the link in that email to complete your subscription.

Once you're subscribed, you'll receive about 100 emails per day. If you want to send an email to the participants, you can just send it to the list's email address.
When replying, it's a good idea to use Reply-All so that your reply reaches the entire list (this keeps the discussion history on the mailing list).

3. Set Up Your Environment

Now it's time to get the OpenJDK source code and set up your development environment.
I usually use Windows 11, so I'll explain the steps on Windows. On macOS or Linux, you can follow similar steps.

Setting up MSYS2

The first thing to do is install MSYS2. MSYS2 provides a Unix-like environment on Windows and includes the toolchain and libraries needed to build OpenJDK. Follow the installation instructions on the official website.

You also need to install necessary libraries and packages. Open an MSYS2 terminal and run the following commands:

pacman -S autoconf make mingw-w64-x86_64-toolchain tar unzip zip

Setting up JTReg

To test OpenJDK later, also install JTReg.
JTReg is the OpenJDK test framework, used for running Java test cases.
Since binaries are not provided, you need to build it from source.

$ git clone https://github.com/openjdk/jtreg
$ cd jtreg
$ sh make/build.sh
# If the above fails, check that JDK is installed and specify it explicitly
$ sh make/build-all.sh --with-jdk=/c/path/to/your/jdk

After a successful build, lib/jtreg.jar will be generated. Note its full path for later use.
Furthermore, adding the bin/ directory to your PATH will be convenient later (allowing you to use the jtreg command).

Setting up the OpenJDK Project

OpenJDK source code is hosted on the GitHub: openjdk/jdk repository.

First, fork the repository and clone it locally. Then set up the environment.

$ git clone https://github.com/<YOUR_GITHUB_USERNAME>/jdk.git
$ cd jdk
$ bash configure --with-jtreg=<PATH_TO_YOUR_JTREG>/lib/jtreg.jar --boot-jdk=<PATH_TO_YOUR_BOOT_JDK>

Note that building OpenJDK requires an existing JDK (reference), so specify its path with the --boot-jdk option.

Optional: Integrate with IntelliJ IDEA

If you try to edit OpenJDK code using IntelliJ IDEA, you'll encounter a lot of mysterious errors and inconsistencies.
This is because IntelliJ IDEA expects to develop something with Java, not develop Java itself.

The JDK repository includes a script to generate IntelliJ IDEA project files. Running this will allow you to comfortably edit JDK code in IntelliJ IDEA.

$ ./bin/idea.sh

4. Find a Bug or Improvement

To submit a patch to OpenJDK, you first need to find a bug or improvement.
Specifically, visit the JDK Bug System and look for an issue you can tackle.
There are various types of issues: bug fixes, new feature proposals, documentation improvements, etc. Choose an issue that matches your interest and skill level.

Every patch must be linked to an issue registered in the JBS, so finding an issue here first is crucial.

You can find contributable issues by filtering with conditions like these:

  • Project is "JDK": The JDK project is the most active and offers many contribution opportunities (other projects are less directly related to the JDK itself).
  • Status is "Open": Target issues that have not yet been fixed or improved.
  • Assignee is "Unassigned": You should not touch issues that are already assigned to other developers. However, if an issue has not been updated for a long time, you can check on the mailing list first.

Additionally, there are issues intentionally left for beginners, which have the "starter" label.
Issues with the "cleanup" label are also suitable for beginners, as they involve code cleanup or refactoring.

If you are not familiar with C++ and want to modify only Java code, look for issues belonging to the "core-libs" component.
These are issues related to Java standard library code.

5. Create a Patch

Once you find an issue you can contribute to, the next step is to create a patch. Read the issue description carefully and understand the cause of the problem or improvement point.

This is similar to contributing to any open-source project. Modify the code, and add test cases if necessary.
Based on my experience with contributions, the OpenJDK codebase is very large and complex, so you might be confused at first.
However, it's important to gradually deepen your understanding by referencing documentation and existing code.

Note that changes should be minimal. Large-scale changes are difficult to review and are less likely to be approved.

Pitfall: It's in the Commit!

Particular attention must be paid to how you write your commits.
First, it's better to have your name and email match those you use on the mailing lists (SHOULD).

$ git config user.name "John Doe"
$ git config user.email "john.doe@example.com"

This will only override the settings for the OpenJDK repository.

Also, you MUST include the issue number in your commit message.
If you make multiple commits, it's fine to include the issue number only in the first commit.
For example, if you are fixing issue JDK-123456789, the commit messages could be:

- 123456789: Fix NPE in path.to.SomeClass when input is null
- Added null check to prevent NPE
- Implemented unit test for null input case

If you don't include the issue number in the commit message, the JDK repository bot won't recognize it properly and your patch may be rejected.

6. Run Tests

After making changes, be sure to run tests to verify that your changes work correctly.
OpenJDK includes a vast number of test cases, and running them ensures that your changes do not negatively affect other parts.
While testing only the changed parts is acceptable, it is strongly recommended to run the tier1 tests (the basic test set) before submitting your patch.

$ make test-tier1

7. Submit a Patch

Once your patch is ready, the next step is to submit it. First, push your changes to your own GitHub repository.

$ git push origin <YOUR_BRANCH_NAME>

Next, create a pull request (PR) against the OpenJDK repository.
The PR title must include the issue number (e.g., 123456789: Fix NPE in path.to.SomeClass).
In the PR description, write details of your changes (it doesn't need to be very long, but it's important to make it easy for reviewers to understand).

8. Review and Integration

Once you create the PR, a bot will edit your comment within about 5 minutes.
OpenJDK Bot comment

This comment shows the PR status and any required actions.
If additional information or corrections are needed, the bot will point them out. Address them accordingly.
When all checks pass and the PR is ready for review, the rfr label is automatically added.

RFR example

Within 1-2 weeks, an OpenJDK committer or reviewer will review the PR.
If revisions are needed, fix the indicated points and update the PR.

After several rounds of review and revision, when the PR is finally approved, the ready label is added.
Once you are confident that everything is fine, comment /integrate to start the merge process.

If You are an Author or Below

If your role is Author or below, merging the PR requires a "Sponsor."
A Sponsor is a Committer or Reviewer who supports your PR.

Usually, the person who reviewed your PR will become your Sponsor, but if no one does, you can ask for help on the mailing list.
The Sponsor comments /sponsor to start the merge.

If You are a Committer or Above

If you have a Committer role or above, you can merge the PR yourself.
Comment /integrate and the merge will start immediately.

Something that Might Surprise You

At this point, you may just hope for a successful merge, but oddly enough, the PR will be Closed rather than Merged.
Don't worry. This is due to OpenJDK's special operational method and means the PR has been successfully merged.

The bot performs an operation equivalent to Merge-and-Squash and integrates your PR into the JDK repository.
Therefore, the PR itself gets a Closed status, but the changes are actually incorporated into the JDK repository. Evidence of this is the integrated label added to the PR.

Integrated label

9. Becoming an Author

Once two or more of your patches are merged, you become eligible to become an Author.

To become an Author, send an email to the leader of the project you contributed to. The email should include your name, email address, GitHub username, and a list of the patches you contributed.
For the JDK project, the leader is Mark Reinhold. Please find his email address on your own (the mailing list is a good place to check).

Send an email like this:

Subject: JDK Author request for: <YOUR_NAME>
Dear Mark Reinhold,

I would like to request Author status for the JDK project.
I have contributed the following patches:
- JDK-123456789: Fix NPE in path.to.SomeClass
- JDK-987654321: Improve performance of path.to.AnotherClass

My Email address: <YOUR_EMAIL>

Thank you for your consideration.
Best regards,
<YOUR_NAME>

You'll typically receive a reply within a week with an invitation link to the OpenJDK community.
Click "accept" at the bottom of the page to complete your OpenJDK user registration.

Note that you will also be registered in Census, the OpenJDK community membership management system. This may take about two weeks.

10. Linking Your GitHub Account with Your OpenJDK Account

Once you become an Author, you need to link your GitHub account to the OpenJDK GitHub repository.
This ensures your contributions are correctly recorded.

Create an issue at this link with the following content:

Project: SKARA
Component: admin
Type: Task

Summary: Add GitHub user <YOUR_GITHUB_USERNAME>

Once the issue is created, an OpenJDK administrator will link your GitHub account.

Conclusion

How was it?
The above is the process for contributing to OpenJDK and becoming an Author.
Contributing to OpenJDK is a valuable experience for the Java ecosystem and also helps improve your technical skills.
Please consider joining the OpenJDK community by using this article as a reference.

Have a great bytecode life!

GitHubで編集を提案

Discussion