setup-java

JFrog Pipelines Documentation

Products
JFrog Pipelines
Content Type
User Guide
ft:sourceType
Paligo

This Pipelines Task installs and sets up OpenJDK.

Prerequisites

None

Usage

Basic:

- task: jfrog/setup-java@v0.1.0
  input:
    majorVersion: "11"
    minorVersion: "0"
    patchVersion: "17"
    buildVersion: "8" 

You can use an Artifactory integration or JFrog Platform Access Token integration and local generic repository to cache the JDK installer. The first run of the task will download the installer from the internet and upload it to Artifactory. Following runs will download the installer from Artifactory instead.

- task: jfrog/setup-java@v0.1.0
  input:
    majorVersion: "11"
    minorVersion: "0"
    patchVersion: "17"
    buildVersion: "8"
    cacheIntegration: "my_artifactory"
    cacheRepository: "pipelines_cache_local"

Input Variables

Name

Required

Default

Description

majorVersion

true

Java major version to be installed

minorVersion

true

 

Java minor version to be installed

patchVersion

true

Java patch version to be installed

buildVersion

true

Java build version to be installed

cacheIntegration

false

Any Artifactory integration or JFrog Platform Access Token integrationavailable

JFrog Platform Access Token integration or Artifactory integration to be used to cache the installer

cacheRepository

false

Artifactory repository to be used to cache the installer

Output Variables

None

Exported Environment Variables

Name

Description

JAVA_HOME

Location where the JDK is installed

JDK_HOME

Location where the JDK is installed

PATH

$JAVA_HOME/bin appended to PATH

How does it work?

To have JDK installed, the task performs the following steps:

  • Downloads JDK archive from https://adoptium.net/temurin/releases/

  • Uploads archive to Artifactory if cache is enabled (Following runs will download from Artifactory)

  • Extracts the archive contents to the step workspace

  • Set up Java environment variables

License

This project is licensed under Apache 2.0 license.