Java对我的jar没有任何作用 - 来自VB.net

时间:2012-12-13 20:59:59

标签: java vb.net minecraft

我创建了一个用于启动游戏(.jar文件)的项目,但它不起作用。我终于尝试了很多东西; Java推出。没有错误。但是1个问题。游戏本身没有启动,我确信我使用了正确的参数,因为我会收到错误。 这是我的代码。我有一个CMD窗口弹出标题为“[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"

1 个答案:

答案 0 :(得分:0)

您应该检查的地方是Launch Minecraft from command line - usename and password as prefix。 例如:

java -Xms512m -Xmx1g -Djava.library.path=natives/ -cp "minecraft.jar;lwjgl.jar;lwjgl_util.jar" net.minecraft.client.Minecraft <username> <sessionID>