当前位置: 首页 > 知识库问答 >
问题:

错误:用Forge启动Minecraft 1.12.2时,找不到或加载主类Net.Minecraft.LaunchWrapper.Launch

苍阳成
2023-03-14

我已经用Python为Minecraft 1.12.2编写了一个启动器,它只是准备一个命令并使用子进程运行它。

这是在Linux Ubuntu上形成的命令:

#!/usr/bin/env bash

java -Xmx4G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M -Djava.library.path=/tmp/tmp2dl6pidh -cp /home/kuba/Desktop/launch/package/libraries/org/apache/maven/maven-artifact/3.5.3/maven-artifact-3.5.3.jar:/home/kuba/Desktop/launch/package/libraries/org/apache/httpcomponents/httpcore/4.3.2/httpcore-4.3.2.jar:/home/kuba/Desktop/launch/package/libraries/org/apache/httpcomponents/httpclient/4.3.3/httpclient-4.3.3.jar:/home/kuba/Desktop/launch/package/libraries/org/apache/logging/log4j/log4j-core/2.8.1/log4j-core-2.8.1.jar:/home/kuba/Desktop/launch/package/libraries/org/apache/logging/log4j/log4j-api/2.8.1/log4j-api-2.8.1.jar:/home/kuba/Desktop/launch/package/libraries/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.jar:/home/kuba/Desktop/launch/package/libraries/org/apache/commons/commons-lang3/3.5/commons-lang3-3.5.jar:/home/kuba/Desktop/launch/package/libraries/org/lwjgl/lwjgl/lwjgl_util/2.9.4-nightly-20150209/lwjgl_util-2.9.4-nightly-20150209.jar:/home/kuba/Desktop/launch/package/libraries/org/lwjgl/lwjgl/lwjgl-platform/2.9.4-nightly-20150209/lwjgl-platform-2.9.4-nightly-20150209-natives-linux.jar:/home/kuba/Desktop/launch/package/libraries/org/lwjgl/lwjgl/lwjgl/2.9.4-nightly-20150209/lwjgl-2.9.4-nightly-20150209.jar:/home/kuba/Desktop/launch/package/libraries/org/scala-lang/scala-xml_2.11/1.0.2/scala-xml_2.11-1.0.2.jar:/home/kuba/Desktop/launch/package/libraries/org/scala-lang/scala-compiler/2.11.1/scala-compiler-2.11.1.jar:/home/kuba/Desktop/launch/package/libraries/org/scala-lang/scala-reflect/2.11.1/scala-reflect-2.11.1.jar:/home/kuba/Desktop/launch/package/libraries/org/scala-lang/scala-swing_2.11/1.0.1/scala-swing_2.11-1.0.1.jar:/home/kuba/Desktop/launch/package/libraries/org/scala-lang/scala-parser-combinators_2.11/1.0.1/scala-parser-combinators_2.11-1.0.1.jar:/home/kuba/Desktop/launch/package/libraries/org/scala-lang/scala-actors-migration_2.11/1.1.0/scala-actors-migration_2.11-1.1.0.jar:/home/kuba/Desktop/launch/package/libraries/org/scala-lang/scala-library/2.11.1/scala-library-2.11.1.jar:/home/kuba/Desktop/launch/package/libraries/org/scala-lang/plugins/scala-continuations-plugin_2.11.1/1.0.2/scala-continuations-plugin_2.11.1-1.0.2.jar:/home/kuba/Desktop/launch/package/libraries/org/scala-lang/plugins/scala-continuations-library_2.11/1.0.2/scala-continuations-library_2.11-1.0.2.jar:/home/kuba/Desktop/launch/package/libraries/org/ow2/asm/asm-all/5.2/asm-all-5.2.jar:/home/kuba/Desktop/launch/package/libraries/it/unimi/dsi/fastutil/7.1.0/fastutil-7.1.0.jar:/home/kuba/Desktop/launch/package/libraries/commons-codec/commons-codec/1.10/commons-codec-1.10.jar:/home/kuba/Desktop/launch/package/libraries/oshi-project/oshi-core/1.1/oshi-core-1.1.jar:/home/kuba/Desktop/launch/package/libraries/commons-logging/commons-logging/1.1.3/commons-logging-1.1.3.jar:/home/kuba/Desktop/launch/package/libraries/commons-io/commons-io/2.5/commons-io-2.5.jar:/home/kuba/Desktop/launch/package/libraries/net/sf/jopt-simple/jopt-simple/5.0.3/jopt-simple-5.0.3.jar:/home/kuba/Desktop/launch/package/libraries/net/sf/trove4j/trove4j/3.0.3/trove4j-3.0.3.jar:/home/kuba/Desktop/launch/package/libraries/net/java/jinput/jinput/2.0.5/jinput-2.0.5.jar:/home/kuba/Desktop/launch/package/libraries/net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-linux.jar:/home/kuba/Desktop/launch/package/libraries/net/java/dev/jna/platform/3.4.0/platform-3.4.0.jar:/home/kuba/Desktop/launch/package/libraries/net/java/dev/jna/jna/4.4.0/jna-4.4.0.jar:/home/kuba/Desktop/launch/package/libraries/net/java/jutils/jutils/1.0.0/jutils-1.0.0.jar:/home/kuba/Desktop/launch/package/libraries/net/minecraftforge/forge/1.12.2-14.23.4.2705/forge-1.12.2-14.23.4.2705.jar:/home/kuba/Desktop/launch/package/libraries/net/minecraft/launchwrapper/1.12/launchwrapper-1.12.jar:/home/kuba/Desktop/launch/package/libraries/lzma/lzma/0.0.1/lzma-0.0.1.jar:/home/kuba/Desktop/launch/package/libraries/io/netty/netty-all/4.1.9.Final/netty-all-4.1.9.Final.jar:/home/kuba/Desktop/launch/package/libraries/java3d/vecmath/1.5.2/vecmath-1.5.2.jar:/home/kuba/Desktop/launch/package/libraries/com/google/guava/guava/21.0/guava-21.0.jar:/home/kuba/Desktop/launch/package/libraries/com/google/code/gson/gson/2.8.0/gson-2.8.0.jar:/home/kuba/Desktop/launch/package/libraries/com/paulscode/codecwav/20101023/codecwav-20101023.jar:/home/kuba/Desktop/launch/package/libraries/com/paulscode/soundsystem/20120107/soundsystem-20120107.jar:/home/kuba/Desktop/launch/package/libraries/com/paulscode/librarylwjglopenal/20100824/librarylwjglopenal-20100824.jar:/home/kuba/Desktop/launch/package/libraries/com/paulscode/libraryjavasound/20101123/libraryjavasound-20101123.jar:/home/kuba/Desktop/launch/package/libraries/com/paulscode/codecjorbis/20101023/codecjorbis-20101023.jar:/home/kuba/Desktop/launch/package/libraries/com/typesafe/config/1.2.1/config-1.2.1.jar:/home/kuba/Desktop/launch/package/libraries/com/typesafe/akka/akka-actor_2.11/2.3.3/akka-actor_2.11-2.3.3.jar:/home/kuba/Desktop/launch/package/libraries/com/ibm/icu/icu4j-core-mojang/51.2/icu4j-core-mojang-51.2.jar:/home/kuba/Desktop/launch/package/libraries/com/mojang/authlib/1.5.25/authlib-1.5.25.jar:/home/kuba/Desktop/launch/package/libraries/com/mojang/text2speech/1.10.3/text2speech-1.10.3-natives-linux.jar:/home/kuba/Desktop/launch/package/libraries/com/mojang/text2speech/1.10.3/text2speech-1.10.3.jar:/home/kuba/Desktop/launch/package/libraries/com/mojang/patchy/1.1/patchy-1.1.jar:/home/kuba/Desktop/launch/package/libraries/com/mojang/realms/1.10.22/realms-1.10.22.jar:/home/kuba/Desktop/launch/package/libraries/jline/jline/2.13/jline-2.13.jar:/home/kuba/Desktop/launch/package/versions/1.12.2/1.12.2.jar net.minecraft.launchwrapper.Launch --username kuba --version 1.12.2 --gameDir /home/kuba/Desktop/launch/package --assetsDir /home/kuba/Desktop/launch/package/assets --assetIndex 1.12 --uuid c8db861e4ea74ebba869459e68de5e15 --accessToken 6cf19a22fac84ebfa62ba697b899bd68 --userType offline --tweakClass net.minecraftforge.fml.common.launcher.FMLTweaker --versionType Forge

这是在Windows 10主页上形成的命令:

@echo off

java -Xmx4G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M -Djava.library.path=C:\Users\kubac\AppData\Local\Temp\tmpsmseu5hx -cp C:\Users\kubac\Desktop\launch\package\libraries\com\google\code\gson\gson\2.8.0\gson-2.8.0.jar:C:\Users\kubac\Desktop\launch\package\libraries\com\google\guava\guava\21.0\guava-21.0.jar:C:\Users\kubac\Desktop\launch\package\libraries\com\ibm\icu\icu4j-core-mojang\51.2\icu4j-core-mojang-51.2.jar:C:\Users\kubac\Desktop\launch\package\libraries\com\mojang\authlib\1.5.25\authlib-1.5.25.jar:C:\Users\kubac\Desktop\launch\package\libraries\com\mojang\patchy\1.1\patchy-1.1.jar:C:\Users\kubac\Desktop\launch\package\libraries\com\mojang\realms\1.10.22\realms-1.10.22.jar:C:\Users\kubac\Desktop\launch\package\libraries\com\mojang\text2speech\1.10.3\text2speech-1.10.3-natives-windows.jar:C:\Users\kubac\Desktop\launch\package\libraries\com\mojang\text2speech\1.10.3\text2speech-1.10.3.jar:C:\Users\kubac\Desktop\launch\package\libraries\com\paulscode\codecjorbis\20101023\codecjorbis-20101023.jar:C:\Users\kubac\Desktop\launch\package\libraries\com\paulscode\codecwav\20101023\codecwav-20101023.jar:C:\Users\kubac\Desktop\launch\package\libraries\com\paulscode\libraryjavasound\20101123\libraryjavasound-20101123.jar:C:\Users\kubac\Desktop\launch\package\libraries\com\paulscode\librarylwjglopenal\20100824\librarylwjglopenal-20100824.jar:C:\Users\kubac\Desktop\launch\package\libraries\com\paulscode\soundsystem\20120107\soundsystem-20120107.jar:C:\Users\kubac\Desktop\launch\package\libraries\com\typesafe\akka\akka-actor_2.11\2.3.3\akka-actor_2.11-2.3.3.jar:C:\Users\kubac\Desktop\launch\package\libraries\com\typesafe\config\1.2.1\config-1.2.1.jar:C:\Users\kubac\Desktop\launch\package\libraries\commons-codec\commons-codec\1.10\commons-codec-1.10.jar:C:\Users\kubac\Desktop\launch\package\libraries\commons-io\commons-io\2.5\commons-io-2.5.jar:C:\Users\kubac\Desktop\launch\package\libraries\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar:C:\Users\kubac\Desktop\launch\package\libraries\io\netty\netty-all\4.1.9.Final\netty-all-4.1.9.Final.jar:C:\Users\kubac\Desktop\launch\package\libraries\it\unimi\dsi\fastutil\7.1.0\fastutil-7.1.0.jar:C:\Users\kubac\Desktop\launch\package\libraries\java3d\vecmath\1.5.2\vecmath-1.5.2.jar:C:\Users\kubac\Desktop\launch\package\libraries\jline\jline\2.13\jline-2.13.jar:C:\Users\kubac\Desktop\launch\package\libraries\lzma\lzma\0.0.1\lzma-0.0.1.jar:C:\Users\kubac\Desktop\launch\package\libraries\net\java\dev\jna\jna\4.4.0\jna-4.4.0.jar:C:\Users\kubac\Desktop\launch\package\libraries\net\java\dev\jna\platform\3.4.0\platform-3.4.0.jar:C:\Users\kubac\Desktop\launch\package\libraries\net\java\jinput\jinput\2.0.5\jinput-2.0.5.jar:C:\Users\kubac\Desktop\launch\package\libraries\net\java\jinput\jinput-platform\2.0.5\jinput-platform-2.0.5-natives-windows.jar:C:\Users\kubac\Desktop\launch\package\libraries\net\java\jutils\jutils\1.0.0\jutils-1.0.0.jar:C:\Users\kubac\Desktop\launch\package\libraries\net\minecraft\launchwrapper\1.12\launchwrapper-1.12.jar:C:\Users\kubac\Desktop\launch\package\libraries\net\minecraftforge\forge\1.12.2-14.23.4.2705\forge-1.12.2-14.23.4.2705.jar:C:\Users\kubac\Desktop\launch\package\libraries\net\sf\jopt-simple\jopt-simple\5.0.3\jopt-simple-5.0.3.jar:C:\Users\kubac\Desktop\launch\package\libraries\net\sf\trove4j\trove4j\3.0.3\trove4j-3.0.3.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\apache\commons\commons-compress\1.8.1\commons-compress-1.8.1.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\apache\commons\commons-lang3\3.5\commons-lang3-3.5.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\apache\httpcomponents\httpclient\4.3.3\httpclient-4.3.3.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\apache\httpcomponents\httpcore\4.3.2\httpcore-4.3.2.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\apache\logging\log4j\log4j-api\2.8.1\log4j-api-2.8.1.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\apache\logging\log4j\log4j-core\2.8.1\log4j-core-2.8.1.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\apache\maven\maven-artifact\3.5.3\maven-artifact-3.5.3.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\lwjgl\lwjgl\lwjgl\2.9.4-nightly-20150209\lwjgl-2.9.4-nightly-20150209.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\lwjgl\lwjgl\lwjgl-platform\2.9.4-nightly-20150209\lwjgl-platform-2.9.4-nightly-20150209-natives-windows.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\lwjgl\lwjgl\lwjgl_util\2.9.4-nightly-20150209\lwjgl_util-2.9.4-nightly-20150209.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\ow2\asm\asm-all\5.2\asm-all-5.2.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\scala-lang\plugins\scala-continuations-library_2.11\1.0.2\scala-continuations-library_2.11-1.0.2.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\scala-lang\plugins\scala-continuations-plugin_2.11.1\1.0.2\scala-continuations-plugin_2.11.1-1.0.2.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\scala-lang\scala-actors-migration_2.11\1.1.0\scala-actors-migration_2.11-1.1.0.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\scala-lang\scala-compiler\2.11.1\scala-compiler-2.11.1.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\scala-lang\scala-library\2.11.1\scala-library-2.11.1.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\scala-lang\scala-parser-combinators_2.11\1.0.1\scala-parser-combinators_2.11-1.0.1.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\scala-lang\scala-reflect\2.11.1\scala-reflect-2.11.1.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\scala-lang\scala-swing_2.11\1.0.1\scala-swing_2.11-1.0.1.jar:C:\Users\kubac\Desktop\launch\package\libraries\org\scala-lang\scala-xml_2.11\1.0.2\scala-xml_2.11-1.0.2.jar:C:\Users\kubac\Desktop\launch\package\libraries\oshi-project\oshi-core\1.1\oshi-core-1.1.jar:C:\Users\kubac\Desktop\launch\package\versions\1.12.2\1.12.2.jar net.minecraft.launchwrapper.Launch --username kuba --version 1.12.2 --gameDir C:\Users\kubac\Desktop\launch\package --assetsDir C:\Users\kubac\Desktop\launch\package\assets --assetIndex 1.12 --uuid 1e12c9641d68419c8e0ef3c43adc9678 --accessToken c270917a4aa44267859663b52ebdf07f --userType offline --tweakClass net.minecraftforge.fml.common.launcher.FMLTweaker --versionType Forge

问题:Ubuntu版本执行完美,没有任何抱怨,但是Windows版本说:

Error: Could not find or load main class net.minecraft.launchwrapper.Launch

它根本就没有开始。

EDIT I没有提供Python代码,因为它很长,它只是将本地代码提取到一个临时文件夹中,并形成启动minecraft的命令,它可以手工编写并粘贴到脚本中执行。

共有1个答案

郦楷
2023-03-14

实际上,在Windows上,类路径分隔符是;否:替换分隔符可以解决此问题

 类似资料:
  • 这是我过去几天一直在处理的错误,不管我做了多少研究,它似乎对我没有任何帮助。 我知道它试图定位,我相信我已经将Eclipse配置为在(default packages)包中查找start.java,它就在那里。但是,我单击run按钮,错误就会不断弹出。请,我迫切需要帮助,任何意见将非常感谢。 [Update]我设法将start.class添加到我的类路径中,我只是尝试了StackExchange上

  • 问题内容: 我在编译和运行Java代码时遇到了麻烦,该代码旨在允许我将Java与模拟建模包Vensim的共享对象接口。 以下代码编译没有错误: 但是,当我尝试运行以下命令时: 我收到以下错误:“错误:找不到或加载主类SpatialModel”。我的SpatialModel.java代码确实包含一个“主要”方法(如下),所以我不确定是什么问题- 有人可以帮我吗?谢谢。 问题答案: 您必须确保将文件的

  • 我一直在搜索这一点,但没有任何帮助,我试图运行的主要类,但不断得到一个错误。我负责这个 我的主文件位于中 我尝试了多个命令,但一无所获。 我想运行位于中的主类,但总是出现此错误,请提供帮助吗?

  • 我有一个名为TestInventory.java的类,其他类在默认包中,都在src文件夹中。然而,当我运行它时,我得到: 错误:找不到或加载主类

  • 问题内容: 我试图将HelloWorld放在.jar文件中并运行它,但是它不起作用。我创建了Java文件并在程序中键入内容,然后用cmd编写: 而且有效。然后我进入 得到了输出 然后我进入 第一行有效,而第二行却给我一个错误: 当我尝试使用64位jre7 \ bin,jdk1.7.0_51 \ bin,jdk1.7.0_51 \ jre \ bin中的java.exe文件打开它时,我得到的输出是(

  • 问题内容: 我通过cmd.exe在Windows 7上使用Java SDK 1.7。直到几个小时前,一切突然都无法正常运行,突然之间我无法运行编译的类文件,标题中始终显示错误。 我似乎能够编译My.java文件,但是无法运行生成的类文件(My.class)。我经常收到错误“错误:找不到或加载主类My.class”。我已经尝试了多个其他类文件,都导致了相同的问题。 如果您想知道,我的“路径”环境变量