HMCL-dev / HMCL-dev/HMCL

[Feature] 草案:提升 HMCL 的 JAR 版本到 23

Open
#5,734 17 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
10.1k
Forks
934
Avg merge
1d 5h
Merged PRs (30d)
82

Description

概述 | Summary

将用于编译 HMCL 的 JDK 版本,和运行时最低 JRE 版本提升至 Java 23。

  • 开发者:建议使用 JDK 25 开发;
  • 一般用户:推送 JRE 25 + JavaFX 25 的安装包;
  • Windows x86 (32-bit) 用户:推送 JRE 23 的安装包。
原因 | Reason

Minecraft 26.1 以后强制要求 Java 25 启动游戏。

JEP 454: Foreign Function & Memory API 于 Java 22 进入稳定状态。该 JEP 提供了在不使用 JNI 的前提下,访问本机原生 API 和手动控制堆外内存的能力。
对于 HMCL 而言,我们可以抛弃 JNA 和其中的平台相关动态链接库文件,减小最终 JAR 包体积;将短暂需要大量内存的操作迁移到手动控制的堆外内存,降低 -Xmx 默认值以节约内存。

JEP 479: Remove the Windows 32-bit x86 Port 移除了 Windows x86 架构的支持。自 Java 24 起,OpenJDK 项目不再支持上述系统。因此,停留在 JRE 23 可以继续保留旧系统的兼容性。

另外,现在 JavaFX 会兼容 Java N-2 ,所以 JavaFX 25 也兼容 Java 23,我们可以对所有 64 位平台统一下载 JavaFX 25;JDK 23 - 25 并没有提供非常多好用的 API,不升级到 Java 25 的代价是可以接受的。

风险 | Risks
  1. FFM 因不在 Windows x86 上支持 stdcall 而无法调用任何 WinAPI;
  2. 暂未找到可用于 Windows x86 的 JRE 23 产物发布页,我们可能还得自己从源码构建;
替代方案 | Alternatives
  • 发布第二个 LTS 版本(但我们大概率是没这个精力的)作为最后兼容 Windows x86 的版本,然后迁移到 Java 25,或;
  • 对着 Windows x86 用户竖中指,然后不发布 LTS 版本,直接迁移到 Java 25,或;
  • 使用黑魔法在 Java 21 上使用预览状态的 FFM,且想办法适配 Java 21、22、23 的 FFM API 变动。
我们是不是忽略了什么

我不知道。但如果我们真的忽略了很重要的事情,你可以在下面留言指出 :)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing HMCL's Java build configuration and release packaging entry points, then compare the required Java 23, Java 25, JavaFX 25, and Windows x86 compatibility matrix. Investigate the FFM and JNA implications and the availability of Windows x86 JRE 23 artifacts. Done means the supported runtime, developer JDK, native libraries, and platform packages are updated without losing the stated compatibility.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
build-system, desktop
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.