A java exception has been occured
Im making my own minecraft server project but im gettin the same error; I made a client and a server cmllib doesnt launches my client so i wanna launch it with java args on my c# launcher
the startup code:
// Java exe yolu (Java 8 JRE veya JDK yüklü olmalı)
string javaPath = @"C:\Program Files\Java\jre1.8.0_441\bin\javaw.exe"; // j
// Minecraft jar ve kütüphane klasör yolları
string gameDir = @"C:\SoraClient";
string assetsDir = System.IO.Path.Combine(gameDir, "assets");
// Classpath, tüm libraries klasöründeki jarları ve client jarını ekle
// Eğer kütüphane dosyaları SoraClient\libraries içindeyse,
// windows için path ayırıcı ; olmalı ve * kullanılabilir.
string classpath = $"{gameDir}\libraries\*;{gameDir}\SoraClient.jar";
// Minecraft ana class'ı
string mainClass = "net.minecraft.client.main.Main";
// Minecraft argümanları (örnek)
string mcArgs = $"--username TestUser --version SoraClient --gameDir "{gameDir}" --assetsDir "{assetsDir}" --assetIndex 1.8 --uuid testuuid --accessToken testtoken --userType mojang";
// ProcessStartInfo ayarları
ProcessStartInfo psi = new ProcessStartInfo()
{
FileName = javaPath,
Arguments = $"-cp "{classpath}" {mainClass} {mcArgs}",
UseShellExecute = false,
RedirectStandardOutput = true,
RedirectStandardError = true,
CreateNoWindow = false // true yaparsan konsol görünmez
};
Process proc = new Process();
proc.StartInfo = psi;
// Çıktı ve hata mesajlarını okuyalım (isteğe bağlı)
proc.OutputDataReceived += (s, ev) => { if (!string.IsNullOrEmpty(ev.Data)) Console.WriteLine(ev.Data); };
proc.ErrorDataReceived += (s, ev) => { if (!string.IsNullOrEmpty(ev.Data)) Console.WriteLine("ERR: " + ev.Data); };
proc.Start();
proc.BeginOutputReadLine();
proc.BeginErrorReadLine();
}
catch (Exception ex)
{
// Hata mesajını ekrana yazdırabilir veya loglayabilirsin
System.Diagnostics.Debug.WriteLine("Hata: " + ex.Message);

5 Replies
⌛ This post has been reserved for your question.
Hey @sifremiunuttum! Please useTIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here./closeor theClose Postbutton above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.
Please format your code to make it more readable. For java, it should look like this:
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.hi
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived.
If your question was not answered yet, feel free to re-open this post or create a new one.
In case your post is not getting any attention, you can try to use /help ping.
Warning: abusing this will result in moderative actions taken against you.