0

我制作了一个用于启动游戏的项目(.jar 文件),但它不起作用。我尝试了很多东西,最后;Java 推出。没有错误。但是1个问题。游戏本身没有启动,我确信我使用了正确的参数,因为我会得到一个错误。这是我的代码。我弹出一个 CMD 窗口,标题为“[path to java]\java.exe”并立即消失。

    Dim process As New Process
    Dim info As New ProcessStartInfo
    info.FileName = GetJavaHome() + "\java.exe"
    info.CreateNoWindow = False
    info.UseShellExecute = False
    info.RedirectStandardError = False
    info.RedirectStandardOutput = True
    '''' Dim args As String = "-jar ""{6}"" -datafolder{0} -natives{1} -lwjgl{2} -mlcfg{3} -mlmod{4} -j{5} -u{6} -s{7}"
    'Got error: Corrupt jar file... Someone with Minecraft Experience can help me to launch it?
    Dim args As String = "-jar ""{6}"" -datafolder ""{0}"" -natives ""{1}"" -lwjgl ""{2}"" -mlcfg ""{3}"" -mlmod ""{4}"" -j ""{6}"" -u ""{7}"" -s ""{8}"""
    ' Got CMD window popping up with error and disappearing
    info.Arguments = String.Format(args, Application.StartupPath, My.Application.Info.DirectoryPath & "\bin\natives\", My.Application.Info.DirectoryPath & "\bin\lwjgl.jar", My.Application.Info.DirectoryPath & "\config\", My.Application.Info.DirectoryPath & "\mods\", My.Application.Info.DirectoryPath & "\mods\", Application.StartupPath & "\bin\minecraft.jar", TextBox1.Text, result)
    'info.Arguments = info.Arguments.Replace("\bin\minecraft.jar", My.Application.Info.DirectoryPath + "\bin\minecraft.jar")
    process.StartInfo = info
    process.Start()

现在,错误是:

 Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/LWJGLException

而且我很确定我通过测试定义了 LWJGL jar 文件:

  "C:\Program Files (x86)\Java\jre7\bin\java.exe" -jar "C:\Users\Max Korlaar\Dropbox\Max & Alex\MineCraft Launcher\MineCraft Launcher\bin\Debug\bin\minecraft.jar" -lwjgl "C:\Users\Max Korlaar\Dropbox\Max & Alex\MineCraft Launcher\MineCraft Launcher\bin\Debug\bin\lwjgl.jar"
4

1 回答 1

0

您应该检查的地方是从命令行启动 Minecraft - 使用名称和密码作为前缀。例子:

java -Xms512m -Xmx1g -Djava.library.path=natives/ -cp "minecraft.jar;lwjgl.jar;lwjgl_util.jar" net.minecraft.client.Minecraft <username> <sessionID>
于 2013-07-23T23:00:38.410 回答