Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
download

GitHub Action

Setup AdoptOpenJDK

v1.0.0

Setup AdoptOpenJDK

download

Setup AdoptOpenJDK

DEPRECATED: Please use actions/setup-java v2 or later to set up OpenJDK from AdoptOpenJDK or Eclipse Temurin

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Setup AdoptOpenJDK

uses: joschi/setup-jdk@v1.0.0

Learn more about this action in joschi/setup-jdk

Choose a version

setup-jdk

This action sets up a Java development environment with the OpenJDK distribution from AdoptOpenJDK for use in actions by:

  • Downloading and caching a version of the OpenJDK by version and adding to PATH. Downloads from AdoptOpenJDK.
  • Registering problem matchers for error output.

The action is based on actions/setup-java and is using the AdoptOpenJDK API for fetching the JDK binaries.

Usage

See action.yml

Basic:

steps:
- uses: actions/checkout@latest
- uses: joschi/setup-jdk@v1
  with:
    java-version: 'openjdk11' // The OpenJDK version to make available on the path
    architecture: 'x64' // defaults to 'x64'
- run: java -cp java HelloWorldApp

Matrix Testing:

jobs:
  build:
    runs-on: ubuntu-16.04
    strategy:
      matrix:
        java: [ 'openjdk8', 'openjdk11', 'openjdk13' ]
    name: Java ${{ matrix.java }} sample
    steps:
      - uses: actions/checkout@master
      - name: Setup java
        uses: joschi/setup-jdk@v1
        with:
          java-version: ${{ matrix.java }}
          architecture: x64
      - run: java -cp java HelloWorldApp

License

The scripts and documentation in this project are released under the MIT License.

Contributions

Contributions are welcome! See Contributor's Guide