[Bug] 使用外置登录和 LiteLoader 的情况没有被 Java 版本自动选择和兼容性检查考虑
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 10.1k
- Forks
- 934
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 82
Description
问题描述 | Bug Description
可能与 #6161 重复,但还是提出来了
authlib-injector 要求 Java 8。
游戏启动例行的“检查 Java 虚拟机与游戏的兼容性” **并不会考虑用户是否使用外置登录方式。**在使用外置登录时选用 Java 7 等版本启动游戏将导致游戏立即启动失败。
java.lang.UnsupportedClassVersionError: moe/yushi/authlibinjector/Premain : Unsupported major.minor version 52.0
FATAL ERROR in native method: processing of -javaagent failed
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown Source)
at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown Source)
Exception in thread "main"
[16:16:30] [HMCL ProcessListener] Minecraft exit with code 1(0x1), type is APPLICATION_ERROR.
另外,在原版或使用 LiteLoader 的 1.11.2 以下版本(尽管 1.11.2 在主界面警告低版本 Java)同时具有 合适架构的 Java 6,7,8 时,
HMCL 会优先选用 Java 7 而非 Java 8,这可能加剧了问题。
虽然更古早的版本 (例如模组端 1.7.2 或 1.6.4)可能确实有使用 Java 8 而非 Java 7 导致崩溃的问题,但或许应该考虑例如 1.8 之后的版本直接选用 Java 8,而不是等到 1.12。
旧截图,但现在还是有类似的问题
1.7.10 Forge 和 1.11.2 Forge 具有以下弹窗,但是 1.11.2 LiteLoader 没有以下弹窗,这是否为预期行为?已知 OptiFine 要求 Java 8。
启动器崩溃报告 / 启动器日志文件 | Launcher Crash Report / Launcher Log File
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Java compatibility check and automatic Java selection described in the issue. Reproduce the external-login/authlib-injector case and the LiteLoader cases with Java 7 and Java 8. Done means compatibility checks account for the external login requirement and Java selection no longer chooses an incompatible version.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- desktop, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100