-
Notifications
You must be signed in to change notification settings - Fork 731
使用 Java 8 运行时禁止更新 #4032
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
使用 Java 8 运行时禁止更新 #4032
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR prevents automatic updates when running HMCL on Java 8 by introducing a version check, centralizing download link logic, and adding new localized resource strings.
- Added a new update requirement dialog for Java versions below 11 in both the upgrade flow and startup tips.
- Refactored architecture-specific Java download link generation into
Metadata.getSuggestedJavaDownloadLink()
. - Introduced new
fatal.deprecated_java_version.update
keys in English, Simplified Chinese, and Traditional Chinese resource files.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties | Added fatal.deprecated_java_version.update message in Simplified Chinese. |
HMCL/src/main/resources/assets/lang/I18N_zh.properties | Added fatal.deprecated_java_version.update message in Traditional Chinese. |
HMCL/src/main/resources/assets/lang/I18N.properties | Added English fatal.deprecated_java_version.update multi-line property. |
HMCL/src/main/java/org/jackhuang/hmcl/upgrade/UpdateHandler.java | Inserted pre-check to block updates on Java < 11 with an error dialog. |
HMCL/src/main/java/org/jackhuang/hmcl/ui/Controllers.java | Simplified Java version tip logic to use the new metadata method and constants. |
HMCL/src/main/java/org/jackhuang/hmcl/Metadata.java | Defined MINIMUM_REQUIRED_JAVA_VERSION and MINIMUM_SUPPORTED_JAVA_VERSION , and added getSuggestedJavaDownloadLink() . |
Comments suppressed due to low confidence (5)
HMCL/src/main/java/org/jackhuang/hmcl/Metadata.java:42
- [nitpick]
MINIMUM_SUPPORTED_JAVA_VERSION
andMINIMUM_REQUIRED_JAVA_VERSION
names are very similar. Consider renaming them (e.g.,MINIMUM_RUN_JAVA_VERSION
vs.MINIMUM_UPGRADE_JAVA_VERSION
) to clarify their distinct purposes.
public static final int MINIMUM_SUPPORTED_JAVA_VERSION = 11;
HMCL/src/main/java/org/jackhuang/hmcl/Metadata.java:103
- Add JavaDoc for
getSuggestedJavaDownloadLink()
to explain its behavior, return value (including null), and when it should be used.
public static @Nullable String getSuggestedJavaDownloadLink() {
HMCL/src/main/java/org/jackhuang/hmcl/upgrade/UpdateHandler.java:106
- Add unit or integration tests for this new Java version check in
updateFrom(...)
to verify that the correct error dialog is shown when running on unsupported Java versions.
if (JavaRuntime.CURRENT_VERSION < Metadata.MINIMUM_SUPPORTED_JAVA_VERSION) {
HMCL/src/main/java/org/jackhuang/hmcl/Metadata.java:103
- Add tests for
getSuggestedJavaDownloadLink()
across different operating systems and architectures to ensure correct URLs or null are returned.
public static @Nullable String getSuggestedJavaDownloadLink() {
HMCL/src/main/resources/assets/lang/I18N.properties:410
- The multi-line property
fatal.deprecated_java_version.update
is missing line continuation backslashes on its last line, which can break parsing. Ensure each continuation line ends with a\\
and that newline escapes are correct.
and will automatically select the appropriate Java for you based on the game version.
如果发出的最后一个支持 Java 8 的正式版中有重大 Bug,我们将不可能再让用户升级到修复后的版本! |
No description provided.