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
1 change: 1 addition & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ What changed in each release, as a user notices it. GitHub's release pages list

- 13 more distributions, the rest of what Foojay lists: AdoptOpenJDK (`adpt`, `adptj9`), Eliya (`eliya`), OJDKBuild (`ojdkbld`), OpenLogic (`opnlgc`), Red Hat (`rdht`), Semeru certified (`semcrt`), Gluon GraalVM (`gln`) and GraalVM CE for JDK 8 to 19 (`grl8`, `grl11`, `grl16`, `grl17`, `grl19`). Red Hat installs from tar.xz, and OJDKBuild on Linux, OpenLogic on macOS and Gluon GraalVM before 22.1 from zips. A `.sdkmanrc` takes SDKMAN's old identifiers for them, such as `11.0.10.j9-adpt` and `22.3.3.r17-grl`. See [distributions.md](distributions.md).
- Mandrel and Liberica NIK install by the GraalVM version they carry again: `java@23.1.12-mandrel` and `java@23.1.8-nik` work, `vfox search java mandrel` lists every release, and `java@23-mandrel` installs the newest 23.x, `23.1.12.1-mandrel`, which runs Java 21. In October 2026 Foojay moved that version from `java_version` to `distribution_version`, and since then release 0.6.2 fails on such versions with `No JDK found`, lists one Mandrel per Java major and installs Mandrel 23.1.8 for `java@21-mandrel`. Installs it made since then keep names after the Java version (`21-mandrel`, `21.0.12.1+2-nik`), and vfox still finds them by those names; uninstall one to get what the spec means now. See [distributions.md](distributions.md#behavior-of-mandrel-and-liberica-nik) ([#106](https://github.com/version-fox/vfox-java/issues/106)).
- A `.sdkmanrc` takes SDKMAN's identifiers of Mandrel and Liberica NIK with the JDK after `.r`: `java=25.0.4.r25-nik` selects `25.0.4-nik`, where release 0.6.2 selects the newest installed release of the major. Of a release that comes for two JDKs, the plugin installs only the newer one's build, so `22.1.r11-mandrel` selects nothing. See [sdkmanrc.md](sdkmanrc.md#sdkmans-spellings) ([#109](https://github.com/version-fox/vfox-java/issues/109)).
- The notes printed by `vfox add java`, `vfox update java` and `vfox info java` are a link to the README, which lists every short name and shows how to search a distribution. Release 0.6.2 gives five short names there but not how to list their versions, while `vfox search java` lists OpenJDK only ([vfox#390](https://github.com/version-fox/vfox/issues/390)).
- Oracle GraalVM and GraalVM Community go by GraalVM's own version, which Foojay has given as `distribution_version` since October 2026. Release 0.6.2 reads `java_version`, which now holds the JDK's version. So it installs the feature release 25.4.4.1.1 for `java@25.0.4.1-graal`, and for `java@25-graal` whenever a feature release is out on the JDK of the newest 25.0 build, and `vfox search java graal` lists no feature release. Now `java@25-graal` installs the newest build of the 25.0 line (`25.0.5-graal` on 2026-10-20), `java@25.0.4.1-graal` installs GraalVM 25.0.4.1, and the feature release is `java@25.4.4.1.1-graal`. `java@25-graalce` installs `25.4.4.1.1-graalce` from Oracle's GraalVM Download Service, where 0.6.2 installed the same file from GitHub as `25.4.4.1-graalce` ([#105](https://github.com/version-fox/vfox-java/issues/105)).
- A 25.0 name that release 0.6.2 installed after Foojay's change can hold a feature release: `25.0.4.1-graal` is GraalVM 25.4.4.1.1, `25.0.4-graal` is 25.2.4 and `25.0.3-graal` is 25.1.3, and the same goes for these names with `-graalce`. vfox does not install a name it already has, so if the GraalVM version that `java -version` prints differs from the name, `vfox uninstall` it and install it again. `25.0.4.1-graalce`, `25.0.4-graalce` and `25.0.3-graalce` no longer install at all, as GraalVM Community's 25.0 line ends with `25.0.2`.
Expand Down
2 changes: 1 addition & 1 deletion docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,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.

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`). `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`). Where the short names differ from SDKMAN's is in [distributions.md](distributions.md#short-names-and-sdkman).

## Foojay

Expand Down
23 changes: 16 additions & 7 deletions docs/e2e.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,15 @@ JDK, so `java` can only come from what vfox installs:
weeks, so that install is faked: its `bin` holds a stand-in `java` that
only prints the name. On Windows the file is written with CRLF line
endings.

On the Temurin rows, a `.sdkmanrc` holding one of SDKMAN's identifiers of
Mandrel and Liberica NIK with the JDK after `.r` must then select the
release it names: `java=25.0.4.r25-nik` selects `25.0.4-nik`, not
`25.0.4.1-nik`, which `ParseLegacyFile` took while it read `25.0.4.r25` as
the release. `java=22.1.r11-mandrel` must select nothing, as the plugin
installs only the JDK 17 build of Mandrel 22.1 (`OwnNumberIdentifiers` in
`tests/e2e/common`). The releases they name and a newer one of each major
are faked the same way.
7. After `vfox use --global`, the JDK on `PATH` reports the requested
`java.version`, the runner's `os.arch` (`amd64` / `aarch64`, which also
catches an x64 JDK emulated on Windows ARM64) and the distribution's
Expand All @@ -176,13 +185,13 @@ JDK, so `java` can only come from what vfox installs:
The default matrix runs every distribution against both vfox channels
(`latest`, `main`):

| Distribution | Release | Covers | amd64 | arm64 |
| ------------ | ------- | ---------------------------------------------------------------------------------------- | ----- | ----- |
| `open` | 25.0.2 | the default distribution, versions without a suffix | ✓ | |
| `tem` | 21.0.8 | the common path (tar.gz on Linux, zip on Windows); the name and number checks of item 4 | ✓ | ✓ |
| `librca-fx` | 25.0.4 | JavaFX bundled builds (`-fx`) | ✓ | ✓ |
| `jb` | 21.0.5 | the tar.gz path on Windows, which has no zip for it | ✓ | ✓ |
| `graalce` | 25.0.2 | a `GRAALVM_HOME` set beforehand keeps its value; Oracle GraalVM's `25-graal` | ✓ | |
| Distribution | Release | Covers | amd64 | arm64 |
| ------------ | ------- | ---------------------------------------------------------------------------------------------- | ----- | ----- |
| `open` | 25.0.2 | the default distribution, versions without a suffix | ✓ | |
| `tem` | 21.0.8 | the common path (tar.gz on Linux, zip on Windows); the name and number checks of items 4 and 6 | ✓ | ✓ |
| `librca-fx` | 25.0.4 | JavaFX bundled builds (`-fx`) | ✓ | ✓ |
| `jb` | 21.0.5 | the tar.gz path on Windows, which has no zip for it | ✓ | ✓ |
| `graalce` | 25.0.2 | a `GRAALVM_HOME` set beforehand keeps its value; Oracle GraalVM's `25-graal` | ✓ | |

Every pinned release is published through Foojay for each platform its row
runs on. OpenJDK and GraalVM Community ship no `windows-aarch64` build, so
Expand Down
3 changes: 3 additions & 0 deletions docs/sdkmanrc.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,15 @@ It never crosses to another distribution, between a JavaFX build and a plain one
| `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 |
| `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` |
| `22.3.3.r17-grl` | GraalVM CE 22.3.3 for JDK 17, `22.3.3-grl17` |
| `22.1.0.1.r17-gln` | Gluon GraalVM 22.1.0.1, `22.1.0.1-gln` |

The last three rows are SDKMAN's identifiers for distributions it no longer lists, with the virtual machine or the JDK in the version, see [distributions.md](distributions.md#short-names-and-sdkman). The plugin installs no JDK 11 build of Gluon GraalVM 22 and no AdoptOpenJDK upstream build, so `22.1.0.1.r11-gln` and `11.0.9.open-adpt` select nothing. Unreleased: release 0.6.2 selects nothing for any of the three.

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. Unreleased: release 0.6.2 takes `25.0.4.r25` for a release, finds none and selects the newest installed release of the major.

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.

## Not finding it
Expand Down
1 change: 1 addition & 0 deletions docs/zh-CN/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

- 新增 13 个发行版,Foojay 列出的发行版从此全都有了:AdoptOpenJDK(`adpt`、`adptj9`)、Eliya(`eliya`)、OJDKBuild(`ojdkbld`)、OpenLogic(`opnlgc`)、Red Hat(`rdht`)、Semeru 认证版(`semcrt`)、Gluon GraalVM(`gln`),以及基于 JDK 8 到 19 的 GraalVM CE(`grl8`、`grl11`、`grl16`、`grl17`、`grl19`)。Red Hat 从 tar.xz 包安装;Linux 上的 OJDKBuild、macOS 上的 OpenLogic 和 22.1 以前的 Gluon GraalVM 从 zip 包安装。`.sdkmanrc` 里写 SDKMAN 以前给它们的标识符也认,例如 `11.0.10.j9-adpt`、`22.3.3.r17-grl`。见 [distributions.md](distributions.md)。
- Mandrel 和 Liberica NIK 重新按它们沿用的 GraalVM 版本号安装:`java@23.1.12-mandrel` 和 `java@23.1.8-nik` 能装了,`vfox search java mandrel` 列出全部版本,`java@23-mandrel` 装最新的 23.x,即运行 Java 21 的 `23.1.12.1-mandrel`。2026 年 10 月,Foojay 把这个版本号从 `java_version` 挪到了 `distribution_version`,此后 0.6.2 装这样的版本都报 `No JDK found`,每个 Java 大版本只列一个 Mandrel,`java@21-mandrel` 装的是 Mandrel 23.1.8。这段时间里它装上的版本按 Java 版本号命名(`21-mandrel`、`21.0.12.1+2-nik`),vfox 仍会按这些名字找到它们;想要这个写法现在所指的版本,先把旧的卸载。见 [distributions.md](distributions.md#mandrel-与-liberica-nik-的行为)([#106](https://github.com/version-fox/vfox-java/issues/106))。
- `.sdkmanrc` 里写 SDKMAN 给 Mandrel 和 Liberica NIK 的、`.r` 后面带 JDK 版本的标识符,会选中标识符指明的版本:`java=25.0.4.r25-nik` 选中 `25.0.4-nik`,0.6.2 选中的则是同一大版本里已安装的最新版本。一个版本同时为两个 JDK 发布时,插件只装较新 JDK 的构建,所以 `22.1.r11-mandrel` 什么都不会选中。见 [sdkmanrc.md](sdkmanrc.md#sdkman-的写法)([#109](https://github.com/version-fox/vfox-java/issues/109))。
- `vfox add java`、`vfox update java` 和 `vfox info java` 打印的 Notes 改成了一个 README 链接,README 里列了全部简称,也写了怎样搜索某个发行版。0.6.2 的 Notes 只给了五个简称,没说怎样列出它们的版本,而 `vfox search java` 只列 OpenJDK([vfox#390](https://github.com/version-fox/vfox/issues/390))。
- Oracle GraalVM 和 GraalVM 社区版改按 GraalVM 自己的版本号命名和查找。从 2026 年 10 月起,Foojay 把这个版本号放在 `distribution_version` 里。0.6.2 仍然读 `java_version`,而它现在是 JDK 的版本号,所以 `java@25.0.4.1-graal` 装上的是特性版本 25.4.4.1.1;只要 25.0 系列最新构建所用的 JDK 上已经出了特性版本,`java@25-graal` 也会装上特性版本;`vfox search java graal` 里也一个特性版本都没有。现在 `java@25-graal` 装的是 25.0 系列的最新构建(2026-10-20 是 `25.0.5-graal`),`java@25.0.4.1-graal` 装的就是 GraalVM 25.0.4.1,那个特性版本要写成 `java@25.4.4.1.1-graal`。`java@25-graalce` 装的是 `25.4.4.1.1-graalce`,从 Oracle 的 GraalVM Download Service 下载;0.6.2 从 GitHub 下载同一个文件,起名 `25.4.4.1-graalce`([#105](https://github.com/version-fox/vfox-java/issues/105))。
- 在 Foojay 改格式之后用 0.6.2 装的 25.0 版本名,里面可能是特性版本:`25.0.4.1-graal` 是 GraalVM 25.4.4.1.1,`25.0.4-graal` 是 25.2.4,`25.0.3-graal` 是 25.1.3,这几个名字换成 `-graalce` 也一样。名字已经装过的,vfox 不会重装,所以如果 `java -version` 打印的 GraalVM 版本和名字对不上,先 `vfox uninstall` 再重新安装。`25.0.4.1-graalce`、`25.0.4-graalce` 和 `25.0.3-graalce` 现在根本装不上了,因为 GraalVM 社区版的 25.0 系列到 `25.0.2` 为止。
Expand Down
2 changes: 1 addition & 1 deletion docs/zh-CN/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ vfox 加载 `metadata.lua`,命令需要时调用相应的钩子,并向钩子

安装后的版本名是 `<java_version>[-<简称>][-fx]`,OpenJDK 没有简称,Mandrel 和 Liberica NIK 用 Foojay 的 `distribution_version` 代替 `java_version`,`graal` 和 `graalce` 用 GraalVM 自己的版本号([versions.md](versions.md#安装后的版本名))。`lib/distribution_version.lua` 把一个写法解析成版本、发行版和 JavaFX 标志,两种顺序都接受(`21-tem`、`tem-21`)。`lib/installed_version.lua` 把用户输入的版本变成已安装的版本名:先看这个名字本身。只写大版本号时,取这个大版本里已安装的最新版本;其他写法则取这个版本本身,或它的最新构建。`PreUse` 到此为止。`ParseLegacyFile` 还会再退一步,取同一大版本里已安装的最新版本。

SDKMAN 有些写法不同(`jbr`、`21.0.12.fx-zulu`、`21.0.12-fx+1.1-librca`、`28.0.0+ea.19-open`),`hooks/parse_legacy_file.lua` 里的 `plugin_spelling` 会在解析之前把它们改写成插件自己的写法。对 SDKMAN 已经不再提供的发行版,同一文件里的 `sdkman_flavours` 把 SDKMAN 写在版本号里的虚拟机或 JDK 版本换成简称(`22.3.3.r17-grl` 就是 `22.3.3-grl17`)。SDKMAN 给版本补的零由 `installed_version.unpad` 去掉(`27.0.0+36` 就是 `27+36`)。简称与 SDKMAN 不同的地方见 [distributions.md](distributions.md#简称与-sdkman-的不同)。
SDKMAN 有些写法不同(`jbr`、`21.0.12.fx-zulu`、`21.0.12-fx+1.1-librca`、`28.0.0+ea.19-open`),`hooks/parse_legacy_file.lua` 里的 `plugin_spelling` 会在解析之前把它们改写成插件自己的写法。对 SDKMAN 已经不再提供的发行版,同一文件里的 `sdkman_flavours` 把 SDKMAN 写在版本号里的虚拟机或 JDK 版本换成简称(`22.3.3.r17-grl` 就是 `22.3.3-grl17`)。对 `sdkman_jdks` 里的 Mandrel 和 Liberica NIK,则是去掉 JDK 版本(`25.0.4.r25-nik` 就是 `25.0.4-nik`)。一个版本同时为两个 JDK 发布时,写了较旧 JDK(由 `older_jdk` 给出)的标识符什么都不选中(`22.1.r11-mandrel`)。SDKMAN 给版本补的零由 `installed_version.unpad` 去掉(`27.0.0+36` 就是 `27+36`)。简称与 SDKMAN 不同的地方见 [distributions.md](distributions.md#简称与-sdkman-的不同)。

## Foojay

Expand Down
Loading
Loading