• Stars
    star
    375
  • Rank 114,096 (Top 3 %)
  • Language
    Java
  • License
    Apache License 2.0
  • Created over 2 years ago
  • Updated 5 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Eclipse Migration Toolkit for Java

Eclipse Migration Toolkit for Java (EMT4J)

EMT4J is a project that aims to simplify the Java version migration. At the moment, this project focuses on three LTS (i.e. Long-Term-Support) versions: 8, 11, and 17. Therefore, if you want to migrate your application running on JDK 8/11 to JDK 11/17, then this project is for you.

EMT4J supports statically checking application artifacts including the project's classes and dependencies. It also supports running as a Java agent to perform runtime checking. During the checking process, EMT4J collects compatibility problems and outputs a report finally. It currently supports HTML, TEXT, and JSON formats. Users transform the project according to the report and finally complete the migration of the Java version.

How to use

Maven Plugin

Find compatibility problems existing in a Maven project

Add the following configuration to pom.xml (root pom.xml if a multi-module project):

<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.emt4j</groupId>
            <artifactId>emt4j-maven-plugin</artifactId>
            <version>0.8.0</version>
            <executions>
                <execution>
                    <phase>process-test-classes</phase>
                    <goals>
                        <goal>check</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <fromVersion>8</fromVersion>
                <toVersion>11</toVersion>
                <outputFile>report.html</outputFile>
            </configuration>
        </plugin>
    </plugins>
</build>

Then run the following command:

$ mvn process-test-classes

EMT4J's report will be generated in the project directory.

Users can also run the following command directly without modifying pom.xml:

# run with default configurations
$ mvn process-test-classes org.eclipse.emt4j:emt4j-maven-plugin:0.8.0:check
# specify outputFile and priority by -D
$ mvn process-test-classes org.eclipse.emt4j:emt4j-maven-plugin:0.8.0:check -DoutputFile=emt4j-report.html -Dpriority=p1

Configurations:

  • fromVersion: the JDK version that the project currently uses. 8 and 11 are supported, and 8 is as default.

  • toVersion: the target JDK version. 11 and 17 are supported, and 11 is as default.

  • outputFile: the destination of EMT4J's report. The default is emt4j-report.html.

  • priority: the minimum rule priority. p1, p2, p3 and p4 are supported. The default is not set.

  • verbose: print more detailed messages if true.

As mentioned earlier, EMT4J supports running as a Java agent. To leverage it in the test process you need to add the following configuration:

<build>
    <plugins>
        <plugin>
            <groupId>org.eclipse.emt4j</groupId>
            <artifactId>emt4j-maven-plugin</artifactId>
            <version>0.8.0</version>
            <executions>
                <execution>
                    <phase>initialize</phase>
                    <goals>
                        <goal>inject-agent</goal>
                    </goals>
                </execution>
                <execution>
                    <id>check</id>
                    <phase>test</phase>
                    <goals>
                        <goal>check</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <fromVersion>8</fromVersion>
                <toVersion>11</toVersion>
                <outputFile>report.html</outputFile>
            </configuration>
        </plugin>
    </plugins>
</build>

Then run the following command:

$ mvn test

Find compatibility problems existing in specified files (classes, JAR, or directory)

$ mvn org.eclipse.emt4j:emt4j-maven-plugin:0.8.0:check-files -Dfiles=...

Java agent and CLI

First, you need to download the build from the link below:

Releases

The build includes two Java agents, command line tools, a maven plugin, and required dependencies.

Use Java agent standalone to perform runtime checking

  • Migration Java version from 8 to 11:

    $ java -javaagent:<path-to-emt4j-build>/lib/agent/emt4j-agent-jdk8-0.8.0.jar=to=11,file=jdk8to11.dat
  • Migration Java version from 11 to 17:

    $ java -javaagent:<path-to-emt4j-build>/lib/agent/emt4j-agent-jdk11-0.8.0.jar=to=17,file=11to17.dat
  • Migration Java version from 8 to 17:

    $ java -javaagent:<path-to-emt4j-build>/lib/agent/emt4j-agent-jdk8-0.8.0.jar=to=17,file=jdk8to17.dat
  • The Java agent will record the compatibility problems found during running into the file. This file is a binary file, you need to transform it to a readable format by the command:

    $ sh <path-to-emt4j-build>/bin/analysis.sh -o report.html <file generated by agent>

Java agent options:

  • file : the output file path. The default is emt4j-${yyyyMMddHHmmss}.dat in the current working directory.

  • to : the target JDK version.

  • priority : the minimum rule priority. p1, p2, p3 and p4 are supported. The default is not set.

Use CLI

The build contains a script named analysis located in the directory bin (.sh is for Mac or Linux users and .bat is for Windows users).

You can use this script to scan compatibility problems that exist in classes, JARS, and directories that contain classes and JARS.

  • Migration Java version from 8 to 11:

    $ sh bin/analysis.sh -f 8 -t 11 -o report.html <files...>
  • Check JVM options

    $ sh bin/analysis.sh -f 8 -t 17 <file that contains JVM options>

Options:

  • -f : the JDK version that the project currently uses. 8 and 11 are supported.

  • -t : the target JDK version. 11 and 17 are supported.

  • -priority : the minimum rule priority. p1, p2, p3 and p4 are supported. The default is not set.

  • -p : the report format, HTML, TXT, and JSON are supported. Default is HTML

  • -o : the output file name (the default name is 'report').

  • -v : print more detailed messages.

Other Documents

Development Guide

More Repositories

1

temurin-build

Eclipse Temurinβ„’ build scripts - common across all releases/versions
Shell
1,009
star
2

containers

Repo containing the dockerfiles and scripts to produce the official eclipse-temurin containers.
Dockerfile
209
star
3

temurin17-binaries

Temurin 17 binaries
186
star
4

temurin8-binaries

Temurin 8 binaries
182
star
5

adoptium

173
star
6

jdk

This repo is an unmodified mirror of source code obtained from OpenJDK. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead use the tested and certified Java SE compatible version that is available at https://adoptium.net.
Java
147
star
7

installer

Installer scripts for Eclipse Temurin binaries
Java
146
star
8

aqa-tests

Home of test infrastructure for Adoptium builds
HTML
127
star
9

temurin11-binaries

Temurin 11 binaries
112
star
10

infrastructure

This repo contains all information about machine maintenance.
Shell
85
star
11

temurin21-binaries

Temurin 21 binaries
50
star
12

adoptium-support

For end-user problems reported with our binary distributions
44
star
13

jdk8u

This repo is an unmodified mirror of source code obtained from OpenJDK. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead use the tested and certified Java SE compatible version that is available at https://adoptium.net.
Java
39
star
14

api.adoptium.net

Adoptium API πŸš€
Kotlin
33
star
15

aqa-test-tools

Home of Test Results Summary Service (TRSS) and PerfNext. These tools are designed to improve our ability to monitor and triage tests at the Adoptium project. The code is generic enough that it is extensible for use by any project that needs to monitor multiple CI servers and aggregate their results.
Jupyter Notebook
28
star
16

bumblebench

A microbenchmarking test framework for Eclipse Adoptium
Java
22
star
17

jmc-build

Contains the Adoptium specific source code overrides and build pipeline script for the Java Mission Control project.
HTML
21
star
18

temurin18-binaries

Temurin 18 binaries
21
star
19

jdk11u

This repo is an unmodified mirror of source code obtained from OpenJDK. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead use the tested and certified Java SE compatible version that is available at https://adoptium.net.
Java
21
star
20

aqa-systemtest

Java load testing and other full system application tests
Java
19
star
21

adoptium.net

Adoptium Website
TypeScript
19
star
22

ci-jenkins-pipelines

jenkins pipeline build scripts
Groovy
18
star
23

temurin

Eclipse Temurinβ„’ project assets
18
star
24

TKG

TestKitGen (TKG)
Java
16
star
25

jdk17u

This repo is an unmodified mirror of source code obtained from OpenJDK. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead use the tested and certified Java SE compatible version that is available at https://adoptium.net.
Java
16
star
26

temurin20-binaries

Temurin 20 binaries
15
star
27

jdk8u_hg

JDK8u mirror from mercurial from
Java
12
star
28

temurin19-binaries

Temurin 19 binaries
12
star
29

jdk11u-fast-startup-incubator

This repo is an unmodified mirror of source code obtained from OpenJDK. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead use the tested and certified Java SE compatible version that is available at https://adoptium.net.
Java
11
star
30

obsolete---adoptium.net

Development of the website has moved to https://github.com/adoptium/website-v2
Handlebars
10
star
31

jdk21

This repo is an unmodified mirror of source code obtained from OpenJDK. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead use the tested and certified Java SE compatible version that is available at https://adoptium.net.
Java
10
star
32

temurin16-binaries

Temurin 16 binaries
9
star
33

temurin22-binaries

Temurin 22 binaries
9
star
34

dash.adoptium.net

Download tracking dashboard
TypeScript
8
star
35

build-jdk

Github action for building JDKs that utilizes the build scripts from the openjdk-build repo
TypeScript
8
star
36

jdk21u

This repo is an unmodified mirror of source code obtained from OpenJDK. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead use the tested and certified Java SE compatible version that is available at https://adoptium.net.
Java
8
star
37

jenkins-helper

Jenkins Node helper API and helper jobs
Groovy
7
star
38

STF

The System Test Framework for executing https://github.com/adoptium/aqa-systemtest
Java
7
star
39

documentation-services

Java
6
star
40

blog.adoptium.net

The official Adoptium Blog
JavaScript
6
star
41

github-release-scripts

Scripts for release artefacts to GitHub releases
Shell
6
star
42

jdk20u

This repo is an unmodified mirror of source code obtained from OpenJDK. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead use the tested and certified Java SE compatible version that is available at https://adoptium.net.
Java
5
star
43

mirror-scripts

OpenJDK source mirroring scripts used by
Shell
4
star
44

marketplace-api.adoptium.net

Adoptium Marketplace API πŸš€
Kotlin
4
star
45

.github

4
star
46

marketplace-data

The official source of Marketplace data (JSON) for feeding Eclipse Temurin binaries to the Marketplace API πŸ’Ύ
4
star
47

alpine-jdk8u

This repo is an unmodified mirror of source code obtained from OpenJDK. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead use the tested and certified Java SE compatible version that is available at https://adoptium.net.
Java
4
star
48

temurin23-binaries

Temurin 23 binaries
4
star
49

jdk20

Java
3
star
50

run-aqa

Repository for the Github Action that enables the running of the Adoptium Quality Assurance (AQA) tests
TypeScript
3
star
51

jdk17

JDK17 mirror. This source code is an unmodified mirror of source code obtained from OpenJDK https://github.com/openjdk/jdk17. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead, use the tested and certified Java SE compatible version of the code that is available at https://www.adoptium.net.
Java
3
star
52

.eclipsefdn

Repository to host configurations related to the Eclipse Foundation.
Jsonnet
2
star
53

documentation

The new documentation for adoptium.net will be initially created in this repo
Shell
2
star
54

jdk19u

This repo is an unmodified mirror of source code obtained from OpenJDK. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead use the tested and certified Java SE compatible version that is available at https://adoptium.net.
Java
2
star
55

adoptium.net-redesign

Adoptium Website
TypeScript
2
star
56

jdk19

jdk19 repository
Java
1
star
57

aarch32-jdk8u_hg

Mirror of the Mercurial Forest for the Linux Aarch32 port from
Java
1
star
58

Incubator

Adoptium Incubator project
1
star
59

jdk16u

This repo is an unmodified mirror of source code obtained from OpenJDK. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead use the tested and certified Java SE compatible version that is available at https://adoptium.net.
Java
1
star
60

temurin-cpe-generator

A tool to generate NIST CPE directory entries for Eclipse Temurin using the Adoptium API.
JavaScript
1
star
61

jdk18u

This repo is an unmodified mirror of source code obtained from OpenJDK. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead use the tested and certified Java SE compatible version that is available at https://adoptium.net.
Java
1
star
62

jdk18

JDK18 mirror. This source code is an unmodified mirror of source code obtained from OpenJDK https://github.com/openjdk/jdk18. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead use the tested and certified Java SE compatible version of the code that is available at https://adoptium.net.
Java
1
star
63

aarch32-jdk8u

This repo is an unmodified mirror of source code obtained from OpenJDK. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead use the tested and certified Java SE compatible version that is available at https://adoptium.net.
Java
1
star
64

jdk22

This repo is an unmodified mirror of source code obtained from OpenJDK. It has been and may still be used to create builds that are untested and incompatible with the Java SE specification. You should not deploy or write to this code, but instead use the tested and certified Java SE compatible version that is available at https://adoptium.net.
Java
1
star