Giter Club home page Giter Club logo

jdk-api-diff's Introduction

WARN - PROJECT IS RETIRED

Please note this project has been retired in favour of https://javaalmanac.io/jdk/21/.


JDK API Diff Report Generator

This project creates a report of all API changes between two different JDK versions, using JapiCmp. You can use this tool for instance to compare OpenJDK 9 and OpenJDK 10, OpenJDK 9 and Oracle JDK 9 etc.

Published reports

Example reports created by this generator can be found in the docs directory:

N => N+1

LTS => LTS+1

LTS => LTS+2

Some of them are huge, so loading may take a bit.

Usage

To create reports yourself, e.g. with different settings, run mvn clean install. The API change report can be found at target/jdk-api-diff.html.

Maven Toolchains are used to locate the JDKs to compare. There must be a toolchain entry of type jdk for each JDK to compare. Provide a file ~.m2/toolchains.xml like this:

<?xml version="1.0" encoding="UTF8"?>
<toolchains>
    <toolchain>
        <type>jdk</type>
        <provides>
            <version>9</version>
            <vendor>openjdk</vendor>
        </provides>
        <configuration>
            <jdkHome>/path/to/jdk-9</jdkHome>
        </configuration>
    </toolchain>
    <toolchain>
        <type>jdk</type>
        <provides>
            <version>10</version>
            <vendor>openjdk</vendor>
        </provides>
        <configuration>
            <jdkHome>/path/to/jdk-10</jdkHome>
        </configuration>
    </toolchain>
</toolchains>

Specify two properties, jdk1 and jdk2 in your pom.xml, identifying the base and target JDK version for the comparison. The values are comma-separated requirements matched against the <provides> configurations of the existing toolchain entries. Both properties must unambiguously identify one toolchain, for example:

<jdk1>version=9,vendor=openjdk</jdk1>
<jdk2>version=10,vendor=openjdk</jdk2>

If there's no matching toolchain or multiple ones match the given requirements, an exception will be raised.

The report is created via the ModuleRepackager class which is executed with the Maven exec plug-in. Adjust the following options passed to that class in pom.xml as needed:

  • --exported-packages-only: true or false, depending on whether only exported packages should be compared or all packages; only applies if both compared versions are Java 9 or later
  • --excluded-packages: a comma-separated listed of package names which should be excluded from the comparison; this can be useful to exclude unsupported packages such as com.apple or to ignore packages missing from Oracle EA builds but present in final versions such as jdk.management.jfr

License

This project is licensed under the Apache License version 2.0.

jdk-api-diff's People

Contributors

dependabot[bot] avatar don-vip avatar gunnarmorling avatar jakewharton avatar karianna avatar knutwannheden avatar lasombra avatar pivovarit avatar reta avatar sanne avatar tellison avatar thomasdarimont avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jdk-api-diff's Issues

Add Jdk17-Jdk21 as pre-generated doc

Could you guys please add as pregenerated docs the diff between all LTS versions, including the diff between JDK17 and 21? 8 to 11 and 11 to 17 are already there. Alternatively can AdoptOpenJDK provide a separate website with these diffs? I tried to generate them but it cannot work in my work set-up.

Thanks for the amazing work you guys did there.

`Jdk8Repackager` should not fail when optional libraries are missing

It looks like Jdk8Repackager tries to process multiple library JARs, some of which are optional. When one of the libraries is missing, repackaging fails. For example the Temurin OpenJDK 8 builds (https://adoptium.net/releases.html?variant=openjdk8) do not seem to include jre/lib/javaws.jar.

Maybe Jdk8Repackager should only require that rt.jar exists and for all other libraries first check if they exist before trying to process them.

(Also it would be good to improve the error output here by joining the lines using \n.)

Add diff between OpenJDK 8 to OpenJDK 9

Good morning,

Maybe, it could be interesting to add the differences between OpenJDK 8 to OpenJDK 9.
Many users continue using OpenJDK 8 as the default JVM.

Another question, in September will appear OpenJDK 11 and it will considered the next LTS JDK. Do you consider interesting to have a compassion from OpenJDK 8 to OpenJDK 11?

Many thanks in advance, great repo.

Juan Antonio

Don't rely on Maven's toolchains.xml when providing custom JDKs locations

For now, in order to provide custom JDKs, we need to first add them to Maven toolchains.xml, then extract corresponding JAVA_HOMEs using a Groovy script, only to add them to build properties.

I'm not sure if there's some deeper context behind it being done this way, but it looks like it could be easily simplified just by supplying the build with JAVA_HOMEs directly:

RUN mvn install -DjavaHome1=FOO -DjavaHome2=FOO

I have a PoC ready that was made alongside #9

You can see the diff here: https://github.com/pivovarit/jdk-api-diff/commit/e95160b52b3bdd21f72e60bbc0be1173ea308095

When running on JDK 17 if logs a lot Unsupported major.minor version 61.0

When I run diff between JDK 11 and 17 I get a lot of errors like:

java.lang.module.InvalidModuleDescriptorException: Unsupported major.minor version 61.0
        at java.base/jdk.internal.module.ModuleInfo.invalidModuleDescriptor(ModuleInfo.java:1092)
        at java.base/jdk.internal.module.ModuleInfo.doRead(ModuleInfo.java:196)
        at java.base/jdk.internal.module.ModuleInfo.read(ModuleInfo.java:132)
        at jdk.jlink/jdk.tools.jmod.JmodTask.describe(JmodTask.java:312)
        at jdk.jlink/jdk.tools.jmod.JmodTask.run(JmodTask.java:217)
        at jdk.jlink/jdk.tools.jmod.Main.run(Main.java:49)
        at jdk.jlink/jdk.tools.jmod.Main$JmodToolProvider.run(Main.java:58)
        at [email protected]/net.adoptopenjdk.jdkapidiff.repackager.Jdk9Repackager.lambda$extractJdkClasses$1(Jdk9Repackager.java:55)
        at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)

compare AdoptOpenJDK8 & ZuluJDK8

can I use this project to compare AdoptOpenJDK8 vs ZuluJDK8?
in general, can it be used to compare JDK from different provider with same major release version

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.