How to engage in the OpenJDK project

OpenJDK logo

Ins and Outs

Volker Simonis, SAP / volker.simonis@gmail.com

https://simonis.github.io/OpenJDKInsAndOuts

The OpenJDK Project

http://openjdk.java.net/

  • Open Source implementation of Java SE
  • Licensed under GPLv2 (with Classpath exception)
  • Reference implementation for Java 7, 8, 9, ..
  • Collaboration space for different implementers:
    • RedHat, SAP, IBM, Google, Intel, Twitter, Azul
  • Playground for Java SE related projects:
    • Coin, InvokeDynamic, Lambda, Nashorn, Jigsaw, ...
    • Graal, Panama, Valhalla, Shanandoa, Metropolis, Loom ...

OpenJDK Genealogy

  • Everything started with an early development version of JDK 7
    • OpenJDK 6 was a retrofitted JDK 6 port of this version
  • IcedTea - a free build harness
  • Today there's a wild zoo of different OpenJDK builds and distributions:
  • "Commercial" versions of OpenJDK
    • Oracle JDK, SAP JVM, HP JDK, Azul Zing, IBM / Open J9 (only class library)

OCA - the Oracle Contribution Agreement

  • Copyright and patent sharing agreement with regard to your contribution
    • Simple dual licensing model
  • Both, you and Oracle, can treat your contribution as if they were the sole owners
  • Oracle guarantees to always publish any contribution under a suitable
    Free Software Foundation (FSF) or Open Source Initiative (OSI) approved license.

OpenJDK and the Java™

  • You are not allowed to call it Java™ (or Java™ compatible) because:
    • "Java" is a registered trademark
    • You don't get access to the Technology Compatibility Kit (TCK)
  • Accessing the TCK requires the signing of the
    OpenJDK Community TCK License Agreement (OCTLA)
    • Only for OpenJDK or "substantially derived" projects
    • OCTLA forbids disclosing TCK information to non-OCTLA licensees
  • OCTLA is no trademark license!
  • "OpenJDK" can be used according to the "OpenJDK Trademark Notice"

OpenJDK Bylaws

  • The "constitution" of the OpenJDK project
  • Define OpenJDK Groups, Projects and Roles
  • Define the Governing Board which manages
    the structure and operation of the OpenJDK community
    • Chair (appointed by Oracle): Georges Saab
    • Vice-Chair (appointed by IBM): John Duimovich
    • OpenJDK Lead (appointed by Oracle): Mark Reinhold
    • At-Large Member (elected by OpenJDK Members): Doug Lea, SUNY Oswego
    • At-Large Member (elected by OpenJDK Members): Andrew Haley, RedHat

OpenJDK Organization

  • Participants: individuals who subscribed to an OpenJDK mailing list
  • Contributors: Participants who signed the OCA
  • Groups (currently 22)
    • consist of Group Members and a Group Lead
      • Group Members elect new Group Members from Contributors
    • sponsor Projects
  • Projects (currently 60)
    • produce artifacts (code, documentation, whole JDK releases)
    • have code repositories, mailing lists and possibly web content
    • consist of Authors, Committers, Reviewers and a Project Lead
      • Project Leads appoint Authors from Contributors
      • Committers elect new Committers from Authors

OpenJDK Infrastructure

Reporting a Bug

  • Try to reproduce the bug with the latest builds (http://jdk8.java.net, http://jdk9.java.net)
  • Try with a debug build (you'll have to build it!) - this may give you more insights
  • Try to write a simple test case (if possible a JTreg test)
  • Search for similar bugs in the bug database https://bugs.openjdk.java.net
    • Not all bugs are visible (security bugs, customer bugs, ..)
  • Non-Authors can only submit through http://bugs.java.com/
    • Creates only a temporary bug IDs - 'real' bug IDs issued after triaging
  • Write directly to the corresponding mailing list:
    • For simply reproducible bugs
    • If you have a hs_err file

OpenJDK Tools - Mercurial

  • Mercurial is a distributed source control system implemented in Python.
  • OpenJDK uses nested sub-repositories (i.e. "forest"):
    • clone them (corba, hotspot, jaxp, jaxws, jdk, langtools, nashorn) manually:
    •                     
      $ hg clone http:/​/hg.openjdk.java.net/jdk9/dev jdk9-dev
      $ cd jdk9-dev
      $ hg clone http:/​/hg.openjdk.java.net/jdk9/dev/corba
      ...
      $ hg clone http:/​/hg.openjdk.java.net/jdk9/dev/nashorn
                          
                        
    • or use the get_source.sh script which does the same in parallel:
    •                     
      $ hg clone http:/​/hg.openjdk.java.net/jdk9/dev jdk9-dev
      $ cd jdk9-dev
      $ sh get_source.sh
                          
                        
  • Use common/bin/hgforest.sh to execute hg commands in all repositories

OpenJDK Tools - Mercurial

Building the OpenJDK

Building the OpenJDK

            
$ hg clone http:/​/hg.openjdk.java.net/jdk10/hs/ jdk10-hs
$ cd jdk10-hs
$ bash ./configure --with-native-debug-symbols=external --with-debug-level=slowdebug
configure: Configuration created at Fri Sep 29 00:43:09 CEST 2017.
...
$ make images LOG=debug
...
Start 2017-09-29 00:44:29
End   2017-09-29 01:02:08
00:17:39 TOTAL
$ ./build/linux-x86_64-normal-server-slowdebug/images/jdk/bin/java -version
openjdk version "10-internal"
OpenJDK Runtime Environment (slowdebug build 10-internal+0-adhoc.simonis.jdk10-hs)
OpenJDK 64-Bit Server VM (slowdebug build 10-internal+0-adhoc.simonis.jdk10-hs mixed mode)
            
          

On error use “make images JOBS=1” and take a look at “build.log

OpenJDK Tools - JTreg

OpenJDK Tools - webrev

  • Webrev is a "poor man's" code review system (e.g. webrev for Bug 8081674)
  • A collection of diffs and patches in different formats
  • Ability to graphically display diffs in HTML-frames
  • May include additional HTML-formatted documentation
  • Ability to automatically link back to Java bugs at https://bugs.openjdk.java.net
  • Simple Korn shell script available from http://hg.openjdk.java.net/code-tools/webrev
  •                 
    $ cd jdk
    $ ksh webrev.ksh -o /tmp -O -c 8081674 -i 8081674.html
    $ unzip -l /tmp/webrev.zip
    ...
         5643  2015-09-25 17:36   webrev/raw_files/old/src/.../jni_util.c
         8643  2015-09-25 17:36   webrev/index.html
    ---------                     -------
       320695                     75 files
                    
                  

Fixing a Bug

JEP - The JDK Enhancement-Proposal & Roadmap Process

JCP - The Java Community Process

  • A formalized mechanism for developing Java specifications
  • Not an independent standards organization / legal entity
    • A vendor consortium dominated by Oracle
  • Membership requires fee for organizations/companies but is free for individuals
  • JSR's (Java Specification Requests) for proposing and specifying new technologies:
    • A final JSR provides a free reference implementation and
    • A TCK (Technology Compatibility Kit) for verification
  • Currently the JCP specifies three platforms: Java ME, Java SE and Java EE
  • JCP is being criticized as being a "rubber stamp organization", but see:

Start your own JEP

  • It requires two or more weeks of engineering effort
  • It makes a significant change to the JDK
  • It is in high demand by developers or customers
  • A pretty good example and blueprint is Azul's JEP 285: Spin-Wait Hints:

  • Proposed on hotspot-dev / core-libs-dev on 10/4/2015
  • Discussed until 2/24/2016
  • Moved to candidate state at 3/4/2016
  • Proposed to target for JDK 9 3/10/2016
  • RFR run from 1/26/2016 until 4/1/2016 on hotspot-compiler-dev

Start your own OpenJDK Project

  • Any Contributor may propose the creation of a new Project
  • At least one Group Lead must sponsor the proposed Project!!!
  • Step 0 (Discuss): "Call for Discussion: <project name>" to discuss list
  • Step 1 (Propose): "CFV: New Project: <project name>" to announce list
  • Step 2 (Vote): "Re: CFV: New Project: <project name>" to discuss list
  • Step 3 (Results): Announce results to announce list

The future of the OpenJDK

  • New six month, release cadence
  • Many new projects: Panama, Valhalla, Graal, Loom, Metropolis
  • Competition: Open J9

https://simonis.github.io/OpenJDKInsAndOuts