3arthqu4ke / headlessmc

Minecraft on the command line
https://3arthqu4ke.github.io/headlessmc/
MIT License
155 stars 18 forks source link

Generated command is too long on Windows #120

Closed Eiim closed 9 months ago

Eiim commented 9 months ago

Launching 1.20.4 (with or without Fabric) on Windows fails as the generated process command is too long.

Example log excerpt:

[main/FINE] [ProcessFactory]: [C:/batch/java17.bat, -Djava.library.path=C:\Users\ethan\Downloads\HeadlessMC\897a8893-7b25-4dc9-a573-1f541c72a9ef\extracted, -cp, C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org\ow2\asm\asm\9.6\asm-9.6.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org\ow2\asm\asm-analysis\9.6\asm-analysis-9.6.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org\ow2\asm\asm-commons\9.6\asm-commons-9.6.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org\ow2\asm\asm-tree\9.6\asm-tree-9.6.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org\ow2\asm\asm-util\9.6\asm-util-9.6.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\net\fabricmc\sponge-mixin\0.12.5+mixin.0.8.5\sponge-mixin-0.12.5+mixin.0.8.5.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\net\fabricmc\intermediary\1.20.4\intermediary-1.20.4.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\net\fabricmc\fabric-loader\0.15.5\fabric-loader-0.15.5.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\com/github/oshi/oshi-core/6.4.5/oshi-core-6.4.5.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\com/google/code/gson/gson/2.10.1/gson-2.10.1.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\com/google/guava/guava/32.1.2-jre/guava-32.1.2-jre.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\com/ibm/icu/icu4j/73.2/icu4j-73.2.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\com/mojang/authlib/6.0.52/authlib-6.0.52.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\com/mojang/blocklist/1.0.10/blocklist-1.0.10.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\com/mojang/brigadier/1.2.9/brigadier-1.2.9.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\com/mojang/datafixerupper/6.0.8/datafixerupper-6.0.8.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\com/mojang/logging/1.1.1/logging-1.1.1.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\com/mojang/patchy/2.2.10/patchy-2.2.10.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\com/mojang/text2speech/1.17.9/text2speech-1.17.9.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\commons-codec/commons-codec/1.16.0/commons-codec-1.16.0.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\commons-io/commons-io/2.13.0/commons-io-2.13.0.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\commons-logging/commons-logging/1.2/commons-logging-1.2.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\io/netty/netty-buffer/4.1.97.Final/netty-buffer-4.1.97.Final.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\io/netty/netty-codec/4.1.97.Final/netty-codec-4.1.97.Final.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\io/netty/netty-common/4.1.97.Final/netty-common-4.1.97.Final.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\io/netty/netty-handler/4.1.97.Final/netty-handler-4.1.97.Final.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\io/netty/netty-resolver/4.1.97.Final/netty-resolver-4.1.97.Final.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\io/netty/netty-transport-classes-epoll/4.1.97.Final/netty-transport-classes-epoll-4.1.97.Final.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\io/netty/netty-transport-native-unix-common/4.1.97.Final/netty-transport-native-unix-common-4.1.97.Final.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\io/netty/netty-transport/4.1.97.Final/netty-transport-4.1.97.Final.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\it/unimi/dsi/fastutil/8.5.12/fastutil-8.5.12.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\net/java/dev/jna/jna-platform/5.13.0/jna-platform-5.13.0.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\net/java/dev/jna/jna/5.13.0/jna-5.13.0.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/apache/commons/commons-compress/1.22/commons-compress-1.22.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/apache/commons/commons-lang3/3.13.0/commons-lang3-3.13.0.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/apache/httpcomponents/httpcore/4.4.16/httpcore-4.4.16.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/apache/logging/log4j/log4j-api/2.19.0/log4j-api-2.19.0.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/apache/logging/log4j/log4j-core/2.19.0/log4j-core-2.19.0.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/apache/logging/log4j/log4j-slf4j2-impl/2.19.0/log4j-slf4j2-impl-2.19.0.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/joml/joml/1.10.5/joml-1.10.5.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-glfw/3.3.2/lwjgl-glfw-3.3.2.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-glfw/3.3.2/lwjgl-glfw-3.3.2-natives-windows.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-glfw/3.3.2/lwjgl-glfw-3.3.2-natives-windows-arm64.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-glfw/3.3.2/lwjgl-glfw-3.3.2-natives-windows-x86.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-jemalloc/3.3.2/lwjgl-jemalloc-3.3.2.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-jemalloc/3.3.2/lwjgl-jemalloc-3.3.2-natives-windows.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-jemalloc/3.3.2/lwjgl-jemalloc-3.3.2-natives-windows-arm64.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-jemalloc/3.3.2/lwjgl-jemalloc-3.3.2-natives-windows-x86.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-openal/3.3.2/lwjgl-openal-3.3.2.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-openal/3.3.2/lwjgl-openal-3.3.2-natives-windows.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-openal/3.3.2/lwjgl-openal-3.3.2-natives-windows-arm64.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-openal/3.3.2/lwjgl-openal-3.3.2-natives-windows-x86.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-opengl/3.3.2/lwjgl-opengl-3.3.2.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-opengl/3.3.2/lwjgl-opengl-3.3.2-natives-windows.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-opengl/3.3.2/lwjgl-opengl-3.3.2-natives-windows-arm64.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-opengl/3.3.2/lwjgl-opengl-3.3.2-natives-windows-x86.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-stb/3.3.2/lwjgl-stb-3.3.2.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-stb/3.3.2/lwjgl-stb-3.3.2-natives-windows.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-stb/3.3.2/lwjgl-stb-3.3.2-natives-windows-arm64.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-stb/3.3.2/lwjgl-stb-3.3.2-natives-windows-x86.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-tinyfd/3.3.2/lwjgl-tinyfd-3.3.2.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-tinyfd/3.3.2/lwjgl-tinyfd-3.3.2-natives-windows.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-tinyfd/3.3.2/lwjgl-tinyfd-3.3.2-natives-windows-arm64.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl-tinyfd/3.3.2/lwjgl-tinyfd-3.3.2-natives-windows-x86.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl/3.3.2/lwjgl-3.3.2.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl/3.3.2/lwjgl-3.3.2-natives-windows.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl/3.3.2/lwjgl-3.3.2-natives-windows-arm64.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/lwjgl/lwjgl/3.3.2/lwjgl-3.3.2-natives-windows-x86.jar;C:\Users\ethan\AppData\Roaming\.minecraft\libraries\org/slf4j/slf4j-api/2.0.7/slf4j-api-2.0.7.jar;C:\Users\ethan\AppData\Roaming\.minecraft\versions\fabric-loader-0.15.5-1.20.4\fabric-loader-0.15.5-1.20.4.jar, -DFabricMcEmu= net.minecraft.client.main.Main , -XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump, -Xss1M, -Djava.library.path=C:\Users\ethan\Downloads\HeadlessMC\897a8893-7b25-4dc9-a573-1f541c72a9ef\extracted, -Djna.tmpdir=C:\Users\ethan\Downloads\HeadlessMC\897a8893-7b25-4dc9-a573-1f541c72a9ef\extracted, -Dorg.lwjgl.system.SharedLibraryExtractPath=C:\Users\ethan\Downloads\HeadlessMC\897a8893-7b25-4dc9-a573-1f541c72a9ef\extracted, -Dio.netty.native.workdir=C:\Users\ethan\Downloads\HeadlessMC\897a8893-7b25-4dc9-a573-1f541c72a9ef\extracted, -Dminecraft.launcher.brand=HeadlessMc, -Dminecraft.launcher.version=1.6.2, net.fabricmc.loader.impl.launch.knot.KnotClient, --username, swestrun, --version, fabric-loader-0.15.5-1.20.4, --gameDir, C:\Users\ethan\AppData\Roaming\.minecraft, --assetsDir, C:\Users\ethan\AppData\Roaming\.minecraft\assets, --assetIndex, 12, --uuid, 5597a334583c412cba87139ed02251b2, --accessToken,...
[22:00:13] [main/FINE] [FileManager]: Checking file: C:\Users\ethan\AppData\Roaming\.minecraft
[22:00:13] [main/INFO] [ProcessFactory]: Game will run in C:\Users\ethan\AppData\Roaming\.minecraft
The command line is too long.
Minecraft exited with code: 1
3arthqu4ke commented 9 months ago

Could you try, instead of using C:/batch/java17.bat, to use an actual java installation? In your config.properties:

hmc.java.versions=C:/Program Files/Java/<java version>/bin/java 

I suspect that the limit comes from using a bat file.

Eiim commented 9 months ago

That works, thanks!