Skip to content

Commit a03d125

Browse files
Glavo3gf8jv4dv
andauthored
将最低 Java 版本提升至 Java 11 (#8)
* 将最低 Java 版本提升至 Java 11 * Update HMCL/i18n.cpp Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com> --------- Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
1 parent 8a4e7fd commit a03d125

3 files changed

Lines changed: 3 additions & 8 deletions

File tree

HMCL/i18n.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ HLI18N HLI18N::Instance() {
88
L"The Java path specified by HMCL_JAVA_HOME is invalid. Please update it to a valid Java "
99
"installation path or remove this environment variable.",
1010
.errorJavaNotFound =
11-
L"The Java runtime environment is required to run HMCL and Minecraft,\n"
11+
L"HMCL requires Java 11 or later to run,\n"
1212
L"Click 'OK' to start downloading java.\n"
1313
L"Please restart HMCL after installing Java."};
1414

@@ -17,7 +17,7 @@ HLI18N HLI18N::Instance() {
1717
i18n.errorSelfPath = L"获取程序路径失败。";
1818
i18n.errorInvalidHMCLJavaHome = L"HMCL_JAVA_HOME 所指向的 Java 路径无效,请更新或删除该变量。\n";
1919
i18n.errorJavaNotFound =
20-
L"运行 HMCL 以及 Minecraft 需要 Java 运行时环境,点击“确定”开始下载。\n"
20+
L"HMCL 需要 Java 11 或更高版本才能运行,点击“确定”开始下载 Java\n"
2121
L"请在安装 Java 完成后重新启动 HMCL。";
2222
}
2323
return i18n;

HMCL/java.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include "path.h"
1212

1313
constexpr std::uint16_t HL_EXPECTED_JAVA_MAJOR_VERSION = 11;
14-
constexpr std::uint16_t HL_LEGACY_JAVA_MAJOR_VERSION = 8; // TODO: Support for Java 8 will be removed in the future
1514

1615
struct HLJavaVersion {
1716
static HLJavaVersion INVALID;
@@ -27,7 +26,7 @@ struct HLJavaVersion {
2726
std::strong_ordering operator<=>(const HLJavaVersion &other) const = default;
2827

2928
[[nodiscard]] bool IsAcceptable() const {
30-
return major >= HL_EXPECTED_JAVA_MAJOR_VERSION || major == HL_LEGACY_JAVA_MAJOR_VERSION;
29+
return major >= HL_EXPECTED_JAVA_MAJOR_VERSION;
3130
}
3231

3332
[[nodiscard]] std::wstring ToWString() const {

HMCL/main.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,6 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmd
178178
HLSearchJavaInRegistry(javaRuntimes, L"SOFTWARE\\JavaSoft\\JDK", javaExecutableName);
179179
HLSearchJavaInRegistry(javaRuntimes, L"SOFTWARE\\JavaSoft\\JRE", javaExecutableName);
180180

181-
// TODO: They are for Java 8 or earlier and will be removed in the future.
182-
HLSearchJavaInRegistry(javaRuntimes, L"SOFTWARE\\JavaSoft\\Java Development Kit", javaExecutableName);
183-
HLSearchJavaInRegistry(javaRuntimes, L"SOFTWARE\\JavaSoft\\Java Runtime Environment", javaExecutableName);
184-
185181
// Try to launch JVM
186182

187183
if (javaRuntimes.runtimes.empty()) {

0 commit comments

Comments
 (0)