Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Oracle JDK #401

Merged
merged 5 commits into from Nov 23, 2022
Merged

Conversation

fniephaus
Copy link
Contributor

Description:
This PR adds Oracle JDK to the list of supported distributions.

Related issue: #69

Check list:

  • Mark if documentation changes are required.
  • Mark if tests were added or updated to cover the changes.

Copy link

@brunoborges brunoborges left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fniephaus
Copy link
Contributor Author

Thanks for approving, @brunoborges. I just pushed a commit that should make the tests work on macOS and Windows.


protected async findPackageForDownload(range: string): Promise<JavaDownloadRelease> {
const arch = this.distributionArchitecture();
if (arch !== 'x64' && arch !== 'aarch64') {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Oralce provides java binaries for aarch64.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Oracle does provide x64 and aarch64 binaries for Linux and macOS. That's why this check throws an error for non-x64 and non-aarch64 architectures.

Note: no aarch64 binaries for Windows, though https://www.oracle.com/java/technologies/downloads/

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +70 to +72
if (parseInt(major) < 17) {
throw new Error('Oracle JDK is only supported for JDK 17 and later');
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove and add it to the documentation because if the versions is not found it will return 404 code. It can be handled further code checks.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding this limitation to the documentation is a good point.

Keeping it here has also an additional value, as users passing lower values for Java's "major" version will see an explicit error message that this vendor only supports "JDK 17 and later".

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's also the following note in https://github.com/actions/setup-java#supported-distributions section.

NOTE: The different distributors can provide discrepant list of available versions / supported configurations. Please refer to the official documentation to see the list of supported versions.

Doesn't this suffice?

@dmitry-shibanov
Copy link
Contributor

Hello @fniephaus. Could you please update documentation for advanced configuration with examples for Oracle JDK ? Besides, If I understood correctly, it is impossible to grab all versions from API ?

@sormuras
Copy link

Could you please update documentation for advanced configuration with examples for Oracle JDK ?

I'll add an example to https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md

Besides, If I understood correctly, it is impossible to grab all versions from API ?

What do you mean with "grab all version from API" ?

Find a list and a description of supported versions at https://www.oracle.com/java/technologies/jdk-script-friendly-urls/

@dmitry-shibanov
Copy link
Contributor

Could you please update documentation for advanced configuration with examples for Oracle JDK ?

I'll add an example to https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md

Besides, If I understood correctly, it is impossible to grab all versions from API ?

What do you mean with "grab all version from API" ?

Find a list and a description of supported versions at https://www.oracle.com/java/technologies/jdk-script-friendly-urls/

For now the logic constructs url from major or full version. Is it possible to get all available versions ?

@sormuras
Copy link

sormuras commented Nov 16, 2022

Ah, understood. AFAIK, it's not possible to get a list of all binaries via an API call.

There is however a listing available per "major" version at: https://www.oracle.com/java/technologies/downloads/archive/

Copy link

@sormuras sormuras left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dmitry-shibanov
Copy link
Contributor

Thank you for your description @sormuras. In this case I'm going to merge the pull request.

@dmitry-shibanov dmitry-shibanov merged commit 6cdf39a into actions:main Nov 23, 2022
@fniephaus fniephaus deleted the oracle-jdk branch December 1, 2022 10:03
@fniephaus
Copy link
Contributor Author

Thanks for merging this, @dmitry-shibanov. When can we expect a new release of this action so that users can use Oracle JDK and actions/setup-java@v3 as recommended?

@dmitry-shibanov
Copy link
Contributor

dmitry-shibanov commented Dec 1, 2022

Hello @fniephaus. We've released a new version of setup-java v3.7.0. Later we'll update the major tag

brcrista added a commit that referenced this pull request Dec 1, 2022
Yash-Garg pushed a commit to Yash-Garg/qBittorrent-Manager that referenced this pull request Dec 1, 2022
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [actions/setup-java](https://togithub.com/actions/setup-java) | action
| minor | `v3.6.0` -> `v3.7.0` |

---

### Release Notes

<details>
<summary>actions/setup-java</summary>

###
[`v3.7.0`](https://togithub.com/actions/setup-java/releases/tag/v3.7.0)

[Compare
Source](https://togithub.com/actions/setup-java/compare/v3.6.0...v3.7.0)

In scope of this release we added support for Oracle JDK
([actions/setup-java#401).
Besides, we added logic to Pass the token input through on GHES for
Microsoft Build of OpenJDK
([actions/setup-java#395)
and updated
[minimatch](https://togithub.com/actions/setup-java/pull/413)
dependency.

```yaml
steps:
  - name: Checkout
    uses: actions/checkout@v3
  - name: Setup-java
    uses: actions/setup-java@v3
    with:
      distribution: oracle
      java-version: 17
```

##### Supported distributions

Currently, the following distributions are supported:

| Keyword | Distribution | Official site | License
|-|-|-|-|
| `temurin` | Eclipse Temurin | [Link](https://adoptium.net/) |
[Link](https://adoptium.net/about.html)
| `zulu` | Azul Zulu OpenJDK |
[Link](https://www.azul.com/downloads/zulu-community/?package=jdk) |
[Link](https://www.azul.com/products/zulu-and-zulu-enterprise/zulu-terms-of-use/)
|
| `adopt` or `adopt-hotspot` | AdoptOpenJDK Hotspot |
[Link](https://adoptopenjdk.net/) |
[Link](https://adoptopenjdk.net/about.html) |
| `adopt-openj9` | AdoptOpenJDK OpenJ9 |
[Link](https://adoptopenjdk.net/) |
[Link](https://adoptopenjdk.net/about.html) |
| `liberica` | Liberica JDK | [Link](https://bell-sw.com/) |
[Link](https://bell-sw.com/liberica_eula/) |
| `microsoft` | Microsoft Build of OpenJDK |
[Link](https://www.microsoft.com/openjdk) |
[Link](https://docs.microsoft.com/java/openjdk/faq)
| `corretto` | Amazon Corretto Build of OpenJDK |
[Link](https://aws.amazon.com/corretto/) |
[Link](https://aws.amazon.com/corretto/faqs/)
| `oracle` | Oracle JDK |
[Link](https://www.oracle.com/java/technologies/downloads/) |
[Link](https://java.com/freeuselicense)

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://app.renovatebot.com/dashboard#github/Yash-Garg/qBittorrent-Manager).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNC40NC4wIiwidXBkYXRlZEluVmVyIjoiMzQuNDQuMCJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@finaroux
Copy link

finaroux commented Dec 1, 2022

Hey I thing this tag was a mistake I have nothing to do with this issue (wrong person). Can you fix it please? Thanks!

dmitry-shibanov added a commit that referenced this pull request Dec 5, 2022
This reverts commit 6cdf39a.

Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>
e-korolevskii pushed a commit to e-korolevskii/setup-java that referenced this pull request Dec 9, 2022
* Fix typo in README.md (actions#419)

`diractory` -> `directory`

* Revert "Add support for Oracle JDK (actions#401)" (actions#421)

This reverts commit 6cdf39a.

Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>

* adding check for prerelease

* add debug lines

* add minor fix

* expand e2e tests with corretto

Co-authored-by: Ashley <73482956+ascopes@users.noreply.github.com>
Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>
dmitry-shibanov added a commit that referenced this pull request Feb 7, 2023
dmitry-shibanov added a commit that referenced this pull request Feb 7, 2023
yeikel pushed a commit to yeikel/setup-java that referenced this pull request Feb 12, 2023
yeikel pushed a commit to yeikel/setup-java that referenced this pull request Feb 12, 2023
This reverts commit 6cdf39a.

Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>
yeikel pushed a commit to yeikel/setup-java that referenced this pull request Feb 12, 2023
fniephaus pushed a commit to graalvm/setup-java that referenced this pull request Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants