[英]Java does nothing with my jar - from VB.net
I made a project for launching a game (.jar file) and it doesn't work. 我为启动游戏(.jar文件)创建了一个项目,但该项目无效。 I tried many things and finally;
我尝试了很多事情,最后; Java launched.
Java启动。 No errors.
没有错误。 But 1 problem.
但是1个问题。 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.
我有一个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()
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: 而且我很确定我通过测试来定义了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"
A place you should check is Launch Minecraft from command line - usename and password as prefix . 您应该检查的地方是从命令行启动Minecraft-使用名称和密码作为前缀 。 Example:
例:
java -Xms512m -Xmx1g -Djava.library.path=natives/ -cp "minecraft.jar;lwjgl.jar;lwjgl_util.jar" net.minecraft.client.Minecraft <username> <sessionID>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.