Skip to content
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

No-launcher: JOptSimple: Found multiple arguments #955

Open
sgp729 opened this issue Jul 27, 2024 · 1 comment
Open

No-launcher: JOptSimple: Found multiple arguments #955

sgp729 opened this issue Jul 27, 2024 · 1 comment

Comments

@sgp729
Copy link

sgp729 commented Jul 27, 2024

The command used to launch the game is:

/usr/bin/java -Djava.library.path=/data/minecraft/versions/1.21/natives -Djna.tmpdir=/data/minecraft/versions/1.21/natives \
              -Dorg.lwjgl.system.SharedLibraryExtractPath=/data/minecraft/versions/1.21/natives \
              -Dio.netty.native.workdir=/data/minecraft/versions/1.21/natives -Xss1M -cp ... \
              net.fabricmc.loader.impl.launch.knot.KnotClient -DFabricMcEmu=net.minecraft.client.main.Main \
              --username=... --version=1.21 --gameDir=/data/minecraft --assetsDir=/data/minecraft/assets --assetIndex=1.21 --accessToken=... --uuid=...

I modified the launch script for vanilla Minecraft, to include fabric libs in classpath, additional flags, etc... but the loader fails to launch with the following error:

net.fabricmc.loader.impl.FormattedException: joptsimple.MultipleArgumentsForOptionException: Found multiple arguments for option version, but you asked for only one
	at net.fabricmc.loader.impl.FormattedException.ofLocalized(FormattedException.java:63) ~[fabric1.21.jar:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:472) ~[fabric1.21.jar:?]
	at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) [fabric1.21.jar:?]
	at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) [fabric1.21.jar:?]
Caused by: joptsimple.MultipleArgumentsForOptionException: Found multiple arguments for option version, but you asked for only one
	at joptsimple.OptionSet.valueOf(OptionSet.java:179) ~[jopt-simple-5.0.4.jar:?]
	at net.minecraft.client.main.Main.a(SourceFile:286) ~[1.21.jar:?]
	at net.minecraft.client.main.Main.main(SourceFile:104) ~[1.21.jar:?]
	at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) ~[fabric1.21.jar:?]
	... 2 more

My installation is bare minimum for launching vanilla minecraft, but I also installed fabric required libs and jars, my directory structure looks like this:

$ tree -L 2 .
.
├── assets
│   ├── indexes
│   └── objects
├── libraries
│   ├── com
│   ├── commons-codec
│   ├── commons-io
│   ├── commons-logging
│   ├── io
│   ├── it
│   ├── net
│   └── org
├── version_manifest_v2.json
└── versions
    ├── 1.21
    └── fabric1.21
$ uname -omr
6.10.0-arch1-2 x86_64 GNU/Linux

It appears that fabric1.21.jar sets its own flags including --version and --accessToken. What am I missing?

Full classpath (SPOILER)
/data/minecraft/versions/1.21/1.21.jar:/data/minecraft/versions/fabric1.21/fabric1.21.jar:/data/minecraft/libraries/com/github/oshi/oshi-core/6.4.10/oshi-core-6.4.10.jar:/data/minecraft/libraries/com/google/code/gson/gson/2.10.1/gson-2.10.1.jar:/data/minecraft/libraries/com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar:/data/minecraft/libraries/com/google/guava/guava/32.1.2-jre/guava-32.1.2-jre.jar:/data/minecraft/libraries/com/ibm/icu/icu4j/73.2/icu4j-73.2.jar:/data/minecraft/libraries/com/mojang/authlib/6.0.54/authlib-6.0.54.jar:/data/minecraft/libraries/com/mojang/blocklist/1.0.10/blocklist-1.0.10.jar:/data/minecraft/libraries/com/mojang/brigadier/1.2.9/brigadier-1.2.9.jar:/data/minecraft/libraries/com/mojang/datafixerupper/8.0.16/datafixerupper-8.0.16.jar:/data/minecraft/libraries/com/mojang/logging/1.2.7/logging-1.2.7.jar:/data/minecraft/libraries/com/mojang/patchy/2.2.10/patchy-2.2.10.jar:/data/minecraft/libraries/com/mojang/text2speech/1.17.9/text2speech-1.17.9.jar:/data/minecraft/libraries/commons-codec/commons-codec/1.16.0/commons-codec-1.16.0.jar:/data/minecraft/libraries/commons-io/commons-io/2.15.1/commons-io-2.15.1.jar:/data/minecraft/libraries/commons-logging/commons-logging/1.2/commons-logging-1.2.jar:/data/minecraft/libraries/io/netty/netty-buffer/4.1.97.Final/netty-buffer-4.1.97.Final.jar:/data/minecraft/libraries/io/netty/netty-codec/4.1.97.Final/netty-codec-4.1.97.Final.jar:/data/minecraft/libraries/io/netty/netty-common/4.1.97.Final/netty-common-4.1.97.Final.jar:/data/minecraft/libraries/io/netty/netty-handler/4.1.97.Final/netty-handler-4.1.97.Final.jar:/data/minecraft/libraries/io/netty/netty-resolver/4.1.97.Final/netty-resolver-4.1.97.Final.jar:/data/minecraft/libraries/io/netty/netty-transport-classes-epoll/4.1.97.Final/netty-transport-classes-epoll-4.1.97.Final.jar:/data/minecraft/libraries/io/netty/netty-transport/4.1.97.Final/netty-transport-4.1.97.Final.jar:/data/minecraft/libraries/it/unimi/dsi/fastutil/8.5.12/fastutil-8.5.12.jar:/data/minecraft/libraries/net/java/dev/jna/jna-platform/5.14.0/jna-platform-5.14.0.jar:/data/minecraft/libraries/net/java/dev/jna/jna/5.14.0/jna-5.14.0.jar:/data/minecraft/libraries/net/sf/jopt-simple/jopt-simple/5.0.4/jopt-simple-5.0.4.jar:/data/minecraft/libraries/org/apache/commons/commons-compress/1.26.0/commons-compress-1.26.0.jar:/data/minecraft/libraries/org/apache/commons/commons-lang3/3.14.0/commons-lang3-3.14.0.jar:/data/minecraft/libraries/org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar:/data/minecraft/libraries/org/apache/httpcomponents/httpcore/4.4.16/httpcore-4.4.16.jar:/data/minecraft/libraries/org/apache/logging/log4j/log4j-api/2.22.1/log4j-api-2.22.1.jar:/data/minecraft/libraries/org/apache/logging/log4j/log4j-core/2.22.1/log4j-core-2.22.1.jar:/data/minecraft/libraries/org/apache/logging/log4j/log4j-slf4j2-impl/2.22.1/log4j-slf4j2-impl-2.22.1.jar:/data/minecraft/libraries/org/jcraft/jorbis/0.0.17/jorbis-0.0.17.jar:/data/minecraft/libraries/org/joml/joml/1.10.5/joml-1.10.5.jar:/data/minecraft/libraries/org/lwjgl/lwjgl-freetype/3.3.3/lwjgl-freetype-3.3.3.jar:/data/minecraft/libraries/org/lwjgl/lwjgl-glfw/3.3.3/lwjgl-glfw-3.3.3.jar:/data/minecraft/libraries/org/lwjgl/lwjgl-jemalloc/3.3.3/lwjgl-jemalloc-3.3.3.jar:/data/minecraft/libraries/org/lwjgl/lwjgl-openal/3.3.3/lwjgl-openal-3.3.3.jar:/data/minecraft/libraries/org/lwjgl/lwjgl-opengl/3.3.3/lwjgl-opengl-3.3.3.jar:/data/minecraft/libraries/org/lwjgl/lwjgl-stb/3.3.3/lwjgl-stb-3.3.3.jar:/data/minecraft/libraries/org/lwjgl/lwjgl-tinyfd/3.3.3/lwjgl-tinyfd-3.3.3.jar:/data/minecraft/libraries/org/lwjgl/lwjgl/3.3.3/lwjgl-3.3.3.jar:/data/minecraft/libraries/org/lz4/lz4-java/1.8.0/lz4-java-1.8.0.jar:/data/minecraft/libraries/org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar:/data/minecraft/libraries/org/ow2/asm/asm/9.6/asm-9.6.jar:/data/minecraft/libraries/org/ow2/asm/asm-analysis/9.6/asm-analysis-9.6.jar:/data/minecraft/libraries/org/ow2/asm/asm-commons/9.6/asm-commons-9.6.jar:/data/minecraft/libraries/org/ow2/asm/asm-tree/9.6/asm-tree-9.6.jar:/data/minecraft/libraries/org/ow2/asm/asm-util/9.6/asm-util-9.6.jar:/data/minecraft/libraries/net/fabricmc/sponge-mixin/0.13.3+mixin.0.8.5/sponge-mixin-0.13.3+mixin.0.8.5.jar
@sgp729
Copy link
Author

sgp729 commented Jul 28, 2024

[SOLUTION] For now the solution is just replace equal signs with spaces

It was happening because Arguments::parse is unable to process args in a form of --argument=value (it only accepts --argument value) and thus arguments get duplicated in MinecraftGameProvider::processArgumentMap

Not sure if I should close the issue though the solution is found, as it may be classified as a bug or a lack of feature because vanilla Minecraft supports both of argument formats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant