简体   繁体   中英

Java does nothing with my jar - from VB.net

I made a project for launching a game (.jar file) and it doesn't work. I tried many things and finally; Java launched. No errors. But 1 problem. The game itself didn't launch, and I'm sure I used the right arguments because I would get an error. Here's my code. I've got a CMD window popping up with the title "[path to java]\\java.exe" and disappearing immediately.

    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()

Now, the error is:

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

And I'm pretty sure I defined the LWJGL jar file with testing this:

  "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"

A place you should check is Launch Minecraft from command line - usename and password as prefix . Example:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM