Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

[中文](zh-CN/changes.md) | [English](changes.md)

What changed in each release, as a user notices it. GitHub's release pages list the pull requests.
What changed in each release, as a user notices it. GitHub's release pages list the pull requests. The newest release at the time of writing is 0.6.4, and `main` is ahead of it by everything under "Unreleased". [install-from-source.md](install-from-source.md) gets you those changes now.

## Unreleased

- A `.sdkmanrc` takes SDKMAN's identifiers of Oracle GraalVM and GraalVM Community, which write the fifth number of GraalVM's version after the `+`: `java=25.0.5.0+3-graal` selects `25.0.5.0.3-graal`, and `java=25.4.4.1+1-graalce` selects `25.4.4.1.1-graalce`. Release 0.6.4 takes that number for a build of the release 25.0.5 and finds no such name. So it selects `25.0.5-graal` where that is installed next to `25.0.5.0.3-graal`, which is a different download (Oracle ships `25.0.5`, `25.0.5.0.2` and `25.0.5.0.3` as three files), and otherwise the newest installed release of 25: a project pinned to `25.0.5.0+3-graal` moves to a newer GraalVM as soon as one is installed. See [sdkmanrc.md](sdkmanrc.md#sdkmans-spellings) ([#124](https://github.com/version-fox/vfox-java/pull/124)).

## 0.6.4 (2026-11-03)

Expand Down
4 changes: 2 additions & 2 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ A few contracts that cost time to find:

Installed names are `<java_version>[-<short name>][-fx]`, with no short name for OpenJDK, Foojay's `distribution_version` in place of `java_version` for Mandrel and Liberica NIK, and GraalVM's own version for `graal` and `graalce` ([versions.md](versions.md#installed-names)). `lib/distribution_version.lua` reads a spec into a version, a distribution and the JavaFX flag, in either order (`21-tem`, `tem-21`). `lib/installed_version.lua` turns a version the user typed into an installed name: the name itself first. A bare major then takes the newest installed release of it, and any other version takes the release itself or its newest build. `PreUse` stops there. `ParseLegacyFile` goes one step further and falls back to the newest installed release of the major. Both leave out Oracle GraalVM's feature releases when they take the newest release of a major, unless nothing else of it is installed (`bare_major_skips`, see below).

SDKMAN spells some things differently (`jbr`, `21.0.12.fx-zulu`, `21.0.12-fx+1.1-librca`, `28.0.0+ea.19-open`), and `plugin_spelling` in `hooks/parse_legacy_file.lua` rewrites them into the plugin's before parsing. For the distributions SDKMAN no longer lists, `sdkman_flavours` there turns the virtual machine or JDK in SDKMAN's version into the short name (`22.3.3.r17-grl` is `22.3.3-grl17`). For Mandrel and Liberica NIK (`sdkman_jdks`) the JDK is dropped (`25.0.4.r25-nik` is `25.0.4-nik`). An identifier with the older JDK of a release that comes for two, which `older_jdk` returns, selects nothing (`22.1.r11-mandrel`). `installed_version.unpad` drops the zeros SDKMAN pads releases with (`27.0.0+36` is `27+36`). Where the short names differ from SDKMAN's is in [distributions.md](distributions.md#short-names-and-sdkman).
SDKMAN spells some things differently (`jbr`, `21.0.12.fx-zulu`, `21.0.12-fx+1.1-librca`, `28.0.0+ea.19-open`), and `plugin_spelling` in `hooks/parse_legacy_file.lua` rewrites them into the plugin's before parsing. For the distributions SDKMAN no longer lists, `sdkman_flavours` there turns the virtual machine or JDK in SDKMAN's version into the short name (`22.3.3.r17-grl` is `22.3.3-grl17`). For Mandrel and Liberica NIK (`sdkman_jdks`) the JDK is dropped (`25.0.4.r25-nik` is `25.0.4-nik`). An identifier with the older JDK of a release that comes for two, which `older_jdk` returns, selects nothing (`22.1.r11-mandrel`). `installed_version.unpad` drops the zeros SDKMAN pads releases with (`27.0.0+36` is `27+36`). In the identifiers of Oracle GraalVM and GraalVM Community (`sdkman_graalvm`) the number after the `+` is the fifth number of GraalVM's version and no build, so `ParseLegacyFile` looks for the installed name with a dot before the others (`25.0.5.0+3-graal` is `25.0.5.0.3-graal`). Where the short names differ from SDKMAN's is in [distributions.md](distributions.md#short-names-and-sdkman).

## Foojay

Expand All @@ -67,7 +67,7 @@ SDKMAN spells some things differently (`jbr`, `21.0.12.fx-zulu`, `21.0.12-fx+1.1
- The package's record (`links.pkg_info_uri`) holds `checksum_type` and either `checksum` or `checksum_uri`. `checksum.lookup` in `lib/checksum.lua` takes the digest of the record first, which also costs no request, and fetches the file only where the record has none. `PreInstall` hands it the function that fetches, which sends a GitHub address through `$VFOX_JAVA_GITHUB_MIRROR`, so the library needs no `http` and the tests need no stub for it. A file that lists other packages only gives none, because the digest of another file would fail an install that is fine: Microsoft's file for its EA build of 11.0.14 for macOS names the GA build.
- `Available` lists a name once where Foojay has two records for it.
- Foojay marks GraalVM Community's monthly feature releases (`25.1.3` and on) as LTS where it lists them the old way round, as it did Oracle GraalVM's. `is_feature_release` in `lib/distribution_version.lua` recognises them, by the minor number, and `Available` drops the note. It is for `graal` and `graalce` only: Mandrel and Liberica NIK carry GraalVM's older numbers up to 24, whose minor is no feature release (`mandrel` `23.1.12` is LTS), and the JDK's from 25 on.
- For a bare major of Oracle GraalVM (`graal`) only, `PreInstall` skips the feature releases, so the 25.0 line is installed. A major that has nothing but feature releases keeps them. GraalVM Community is not filtered, because its feature releases are what it still ships. `bare_major_skips` in `lib/distribution_version.lua` holds that rule. `PreUse` and `ParseLegacyFile` apply it to the installed versions as well, so that `vfox use` and a `.sdkmanrc` select the build `PreInstall` installs: the newest installed release of the major that is no feature release, else the newest feature release. `ParseLegacyFile` applies it to the fallback for a release that is not installed too, except when the file names a feature release (`25.4.4+1-graal`, as SDKMAN spells one), which takes the newest release of the major as before.
- For a bare major of Oracle GraalVM (`graal`) only, `PreInstall` skips the feature releases, so the 25.0 line is installed. A major that has nothing but feature releases keeps them. GraalVM Community is not filtered, because its feature releases are what it still ships. `bare_major_skips` in `lib/distribution_version.lua` holds that rule. `PreUse` and `ParseLegacyFile` apply it to the installed versions as well, so that `vfox use` and a `.sdkmanrc` select the build `PreInstall` installs: the newest installed release of the major that is no feature release, else the newest feature release. `ParseLegacyFile` applies it to the fallback for a release that is not installed too, except when the file names a feature release (`25.4.4.1+1-graal`, as SDKMAN spells one, or `25.4.4+1-graal`), which takes the newest release of the major as before.
- The CPU names are `arm64` to `aarch64`, and on Windows `amd64` to `x64`. `darwin` becomes `macos`. On Linux `ldd --version` decides between glibc and musl.

## Tests
Expand Down
6 changes: 6 additions & 0 deletions docs/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,12 @@ JDK, so `java` can only come from what vfox installs:
which is a feature release as soon as one is installed
([#110](https://github.com/version-fox/vfox-java/issues/110)). Each faked
build holds a stand-in `java` that only prints its name, as in item 6.
A `.sdkmanrc` holding SDKMAN's identifier of each faked build that has
five numbers (`25.0.5.0.3-graal` is `25.0.5.0+3-graal`, `25.4.4.1.1-graal`
is `25.4.4.1+1-graal`; `GraalVMIdentifiers` in `tests/e2e/common`) must
select that build, not the `25.0.5-graal` next to it or a newer release.
`ParseLegacyFile` took the number after the `+` for a build of the release
([#124](https://github.com/version-fox/vfox-java/pull/124)).
Once the 25.0 line is removed, `vfox use` and the `.sdkmanrc` must both
select the newest feature release.
4. On the Temurin rows, which run on every runner, the distributions the
Expand Down
9 changes: 6 additions & 3 deletions docs/sdkmanrc.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ vfox's shell hook reads the file when you enter the directory and selects the JD

The plugin matches the identifier against the JDKs that are installed, in this order:

1. An installed name written as it is: `java=21.0.8+9-tem`, `java=28-ea+19`.
1. An installed name written as it is: `java=21.0.8+9-tem`, `java=28-ea+19`. For Oracle GraalVM and GraalVM Community the number after the `+` is the fifth number of the version, so `java=25.0.5.0+3-graal` names `25.0.5.0.3-graal`, see [SDKMAN's spellings](#sdkmans-spellings).
2. The release you named, with its newest installed build: `21.0.8-tem` selects `21.0.8+9-tem`.
3. Failing that, the newest installed release of the same major. `21-tem` goes straight to this step.

Step 3 does not check that the release is at least the one named. With only `21.0.8+9-tem` installed, `java=21.0.12-tem` selects it, and so does `java=21.0.3-tem`. A build number that is not installed falls back to the newest installed build of the release (`21.0.8+7-tem` selects `21.0.8+9-tem`). If the major is not installed at all, nothing is selected.

For Oracle GraalVM, step 3 leaves out the monthly feature releases (`25.4.4.1.1-graal`), as `vfox use java@25-graal` does, so `java=25-graal` and `java=25.0.3-graal` select the newest installed build of the 25.0 line. If nothing else of 25 is installed, a feature release is taken. If the file names a feature release (SDKMAN spells one `25.4.4+1-graal`), the newest installed release of 25 is taken.
For Oracle GraalVM, step 3 leaves out the monthly feature releases (`25.4.4.1.1-graal`), as `vfox use java@25-graal` does, so `java=25-graal` and `java=25.0.3-graal` select the newest installed build of the 25.0 line. If nothing else of 25 is installed, a feature release is taken. If the file names a feature release that is not installed (SDKMAN has spelled one `25.4.4.1+1-graal` and `25.4.4+1-graal`), the newest installed release of 25 is taken.

It never crosses to another distribution, between a JavaFX build and a plain one, or between an early-access build and a release.

Expand All @@ -56,6 +56,7 @@ It never crosses to another distribution, between a JavaFX build and a plain one
| `21.0.12-fx+1.1-librca` | Liberica with JavaFX (newer spelling) |
| `21.0.8+1.1-tem` | Temurin 21.0.8, see below |
| `27.0.0+36-librca`, `25.0.1.0+8-open` | `27+36-librca`, `25.0.1+8`: the zeros are dropped |
| `25.0.5.0+3-graal`, `25.4.4.1+1-graalce` | `25.0.5.0.3-graal`, `25.4.4.1.1-graalce`: the number after the `+` is the fifth number of GraalVM's version |
| `28.ea.19-open`, `28.0.0+ea.19-open` | the early-access build `28-ea+19` |
| `25.0.4.r25-nik`, `25.0.2.r25-mandrel` | `25.0.4-nik`, `25.0.2-mandrel`: `.r` and the JDK after it are dropped |
| `11.0.10.hs-adpt`, `11.0.10.j9-adpt` | AdoptOpenJDK with HotSpot, `11.0.10-adpt`, and with OpenJ9, `11.0.10-adptj9` |
Expand All @@ -66,7 +67,9 @@ The last three rows are SDKMAN's identifiers for distributions it no longer list

SDKMAN writes the JDK into some versions of Mandrel and Liberica NIK as well, which the plugin names after the GraalVM version alone, see [distributions.md](distributions.md#behavior-of-mandrel-and-liberica-nik). Of a release that comes for two JDKs, the plugin installs only the build for the newer one, so an identifier with the older one selects nothing: `22.1.r11-mandrel`, `23.0.1.r17-nik`. The older JDK is 11 from 21.3 to 22.3.5 and 17 from 23 to 23.0.1.2. `25.r25-mandrel` has only the major and selects the newest installed Mandrel 25, as `java=25-mandrel` does, while SDKMAN installs 25.0.1.0 for it.

The number after `+` in SDKMAN's newer identifiers (`21.0.8+1.1-tem`) counts SDKMAN's own rebuilds. It is not a build number of the vendor, so the plugin does not look for one and takes the release. Foojay, and so the installed name, has no zero padding, which is why `27.0.0` means the release `27`. A `.0` padding in `sdk list java` is common (`25.0.1.0+8-open`, `21.0.9.0+116386-jbr`), and the plugin reads it as well.
The number after `+` in SDKMAN's newer identifiers is a build number, the vendor's (`25.0.5.0+8-tem` is Temurin's build 8, installed as `25.0.5+8-tem`) or SDKMAN's own count of its rebuilds (`21.0.8+1.1-tem`). The plugin looks for an installed build of that number first and otherwise takes the release. Foojay, and so the installed name, has no zero padding, which is why `27.0.0` means the release `27`. A `.0` padding in `sdk list java` is common (`25.0.1.0+8-open`, `21.0.9.0+116386-jbr`), and the plugin reads it as well.

Oracle GraalVM and GraalVM Community are the exception. Their versions have five numbers (`25.0.5.0.3`) where SDKMAN's identifiers have four before the `+`, so SDKMAN writes the fifth after it: `25.0.5.0+3-graal` is GraalVM 25.0.5.0.3, and `25.4.4.1+1-graalce` is the feature release 25.4.4.1.1. That number belongs to the release. Oracle ships `25.0.5`, `25.0.5.0.2` and `25.0.5.0.3` as three different files. The plugin looks for the installed name with the dot first, and failing that goes on with steps 2 and 3 as for any release that is not installed. `vfox install` takes the dotted name only (`java@25.0.5.0.3-graal`), not the identifier. Unreleased: release 0.6.4 takes the number for a build of the release `25.0.5`. So it selects `25.0.5-graal` when that is installed next to `25.0.5.0.3-graal`, and a newer release of 25 when that is installed instead.

## Not finding it

Expand Down
6 changes: 5 additions & 1 deletion docs/zh-CN/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@

[中文](changes.md) | [English](../changes.md)

按发布版本列出用户能感受到的变化。GitHub 的 Release 页面列出了对应的 PR。
按发布版本列出用户能感受到的变化。GitHub 的 Release 页面列出了对应的 PR。写这篇文档时最新的发布版是 0.6.4,`main` 比它多出“未发布”下面的所有内容。想现在就用上这些变化,见 [install-from-source.md](install-from-source.md)。

## 未发布

- `.sdkmanrc` 里写 SDKMAN 给 Oracle GraalVM 和 GraalVM 社区版的标识符时,会选中它指明的版本。SDKMAN 把这两个发行版版本号的第五位写在 `+` 后面:`java=25.0.5.0+3-graal` 选中 `25.0.5.0.3-graal`,`java=25.4.4.1+1-graalce` 选中 `25.4.4.1.1-graalce`。0.6.4 把这个数字当作 25.0.5 的构建号,找不到这样的名字,于是 `25.0.5-graal` 和 `25.0.5.0.3-graal` 都装着时选中前者,而它们是不同的下载(Oracle 把 `25.0.5`、`25.0.5.0.2` 和 `25.0.5.0.3` 发布成了三个文件);没装 `25.0.5-graal` 时则选 25 里已安装的最新版本:钉在 `25.0.5.0+3-graal` 上的项目,一装了更新的 GraalVM 就会换过去。见 [sdkmanrc.md](sdkmanrc.md#sdkman-的写法)([#124](https://github.com/version-fox/vfox-java/pull/124))。

## 0.6.4(2026-11-03)

Expand Down
Loading
Loading