![](/img/trans.png)
[英]Running JAR application (Java) within the window of a VB.NET application?
[英]Java does nothing with my jar - from VB.net
我為啟動游戲(.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"
您應該檢查的地方是從命令行啟動Minecraft-使用名稱和密碼作為前綴 。 例:
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.