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"