You can now use setup-java v2 to download and cache binaries from different distributions, including Adopt OpenJDK and Zulu OpenJDK.
With setup-java v2, you can:
- Add Java distributions of your choice
- Get native support for Adopt OpenJDK
- Reduce your Java setup time significantly as the action can utilize pre-cached Adopt OpenJDK distributions from GitHub-hosted runner images
As part of the v2 release, setup-java now requires a mandatory distribution
argument and no longer supports legacy Java version syntax 1.x. You can use our migration guide to learn more about upgrading to v2.
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'
- run: java -cp java HelloWorldApp
For questions, visit the setup-java repo and GitHub Actions community