Use a specific Java version with GitHub Actions
Published:
, Updated:
Talks about:
<a class="post-tag post-tag-github" href="/tags/github">github</a>, <a class="post-tag post-tag-github-actions" href="/tags/github-actions">github actions</a>, and <a class="post-tag post-tag-java" href="/tags/java">java</a>
The setup-java action allows to use a specific Java version in your GitHub Action.
name: <PIPELINE>
jobs:
build:
runs-on: <RUN_ON>
steps:
- name: Set up JDK <JDK_VERSION>
uses: actions/setup-java@v1
with:
java-version: <JDK_VERSION>
<PIPELINE>
: The name of your pipeline.<RUN_ON>
: The runner to use, see GitHub’s own documentation for possible values.<JDK_VERSION>
: The required Java version for your project.