title: Minecraft not starting
body: <p>I am in a project of a launcher minecraft, but without using java! only C#.</p>
  
  <p>I have this code but do not know what's going wrong, just the java open but then closes.</p>
  
  <pre><code>public void RunMinecraft()
      {
          List&lt;string&gt; j_args = new List&lt;string&gt;();
          List&lt;string&gt; libraries = new List&lt;string&gt;();
  
          args = "";
  
          int x = Convert.ToInt32(numericUpDown1.Value);
          j_args.Add("-XX:HeapDumpPath=MojangTricksIntelDriversForPerformance_javaw.exe_minecraft.exe.heapdump");
          j_args.Add("-Xmx" + x + "G");
          j_args.Add("-Djava.library.path=" + Application.StartupPath + "\\data\\natives");
          j_args.Add("net.minecraft.client.main.Main");
          string lib = Application.StartupPath + "\\data\\libraries\\{0}";
          string app = Application.StartupPath;
          string game = Application.StartupPath + "\\data\\game";
          string assets = Application.StartupPath + "\\data\\assets";
  
          #region LIBRARIES
          libraries.Add(format2(lib, "oshi-core-1.1.jar"));
          libraries.Add(format2(lib, "jna-3.4.0.jar"));
          libraries.Add(format2(lib, "platform-3.4.0.jar"));
          libraries.Add(format2(lib, "icu4j-core-mojang-51.2.jar"));
          libraries.Add(format2(lib, "jopt-simple-4.6.jar"));
          libraries.Add(format2(lib, "codecjorbis-20101023.jar"));
          libraries.Add(format2(lib, "codecwav-20101023.jar"));
          libraries.Add(format2(lib, "libraryjavasound-20101123.jar"));
          libraries.Add(format2(lib, "librarylwjglopenal-20100824.jar"));
          libraries.Add(format2(lib, "soundsystem-20120107.jar"));
          libraries.Add(format2(lib, "netty-all-4.0.23.Final.jar"));
          libraries.Add(format2(lib, "guava-17.0.jar"));
          libraries.Add(format2(lib, "commons-lang3-3.3.2.jar"));
          libraries.Add(format2(lib, "commons-io-2.4.jar"));
          libraries.Add(format2(lib, "commons-codec-1.9.jar"));
          libraries.Add(format2(lib, "jinput-2.0.5.jar"));
          libraries.Add(format2(lib, "jutils-1.0.0.jar"));
          libraries.Add(format2(lib, "gson-2.2.4.jar"));
          libraries.Add(format2(lib, "authlib-1.5.21.jar"));
          libraries.Add(format2(lib, "realms-1.7.48.jar"));
          libraries.Add(format2(lib, "httpcore-4.3.2.jar"));
          libraries.Add(format2(lib, "log4j-api-2.0-beta9.jar"));
          libraries.Add(format2(lib, "log4j-core-2.0-beta9.jar"));
          libraries.Add(format3(lib, "1.8.6.jar"));
          #endregion
  
          var librariesSTR = "";
  
          var enum0 = libraries.GetEnumerator();
          while (enum0.MoveNext())
          {
              librariesSTR += enum0.Current;
          }
  
          j_args.Add("-cp " + librariesSTR);
          j_args.Add("--username " + username.Text);
          j_args.Add("--accessToken " + accesstoken.Text);
          j_args.Add("--userProperties {}");
          j_args.Add("--version 1.8.6");
          j_args.Add("--gameDir " + game);
  
          var argsSTR = "";
          var enum1 = j_args.GetEnumerator();
          while (enum1.MoveNext())
          {
              argsSTR += enum1.Current + " ";
          }
  
          ProcessStartInfo info = new ProcessStartInfo();
          info.FileName = @"C:\Program Files\Java\jre7\bin\java.exe";
          info.Arguments = args;
  
          info.UseShellExecute = false;
          info.RedirectStandardOutput = true;
          info.RedirectStandardError = true;
  
          Process p = new Process();
          p.StartInfo = info;
          p.OutputDataReceived += P_OutputDataReceived;
          info.CreateNoWindow = true;
  
          p.Start();
          p.BeginOutputReadLine();
  
          // Clipboard.SetText(argsSTR);
      }
  
      private string format3(string a, string b)
      {
          return string.Format(a, b);
      }
  
      #region format2
      private string format2(string a, string b)
      {
          return string.Format(a, b) + ";";
      }
      #endregion
  </code></pre>
  
  <p>I use the format2 function to cause it to the formatting of all the libraries correctly. Example:</p>
  
  <pre><code>libraries.Add("unnamed_lib1.jar"); libraries.Add ("unnamed_lib2.jar");
  </code></pre>
  
  <p>the result will look like this: </p>
  
  <pre><code>args = "unnamed_lib1.jar;unnamed_lib2.jar;";
  </code></pre>
  
  <p>And the function format3(string a, string b); is the event to finish with the JAR file of the game.
  Example: "1.8.9.jar" without the ';' at the end</p>
  
  <blockquote>
    <p><strong>Sorry for the misspelling because I do not speak much English. And I am using Google translator to help me with the texts.<br><br>
    I'm using the 1.8.6 version of minecraft to start</strong></p>
  </blockquote>