Hi everyone, first time poster so I apologise if I'm not that great.
Basically, I am looking into creating a Minecraft Launcher and I cannot for the life of me get this to work correctly.
public static String authCode = "cmd javaw.exe -Xmx1G -Djava.library.path=\"%APPDATA%\\.minecraft\\versions\\1.6.2\\1.6.2-natives\" -cp \"%APPDATA%\\.minecraft\\libraries\\net\\sf\\jopt-simple\\jopt-simple\\4.5\\jopt-simple-4.5.jar;%APPDATA%\\.minecraft\\libraries\\com\\paulscode\\codecjorbis\\20101023\\codecjorbis-20101023.jar;%APPDATA%\\.minecraft\\libraries\\com\\paulscode\\codecwav\\20101023\\codecwav-20101023.jar;%APPDATA%\\.minecraft\\libraries\\com\\paulscode\\libraryjavasound\\20101123\\libraryjavasound-20101123.jar;%APPDATA%\\.minecraft\\libraries\\com\\paulscode\\librarylwjglopenal\\20100824\\librarylwjglopenal-20100824.jar;%APPDATA%\\.minecraft\\libraries\\com\\paulscode\\soundsystem\\20120107\\soundsystem-20120107.jar;%APPDATA%\\.minecraft\\libraries\\argo\\argo\\2.25_fixed\\argo-2.25_fixed.jar;%APPDATA%\\.minecraft\\libraries\\org\\bouncycastle\\bcprov-jdk15on\\1.47\\bcprov-jdk15on-1.47.jar;%APPDATA%\\.minecraft\\libraries\\com\\google\\guava\\guava\\14.0\\guava-14.0.jar;%APPDATA%\\.minecraft\\libraries\\org\\apache\\commons\\commons-lang3\\3.1\\commons-lang3-3.1.jar;%APPDATA%\\.minecraft\\libraries\\commons-io\\commons-io\\2.4\\commons-io-2.4.jar;%APPDATA%\\.minecraft\\libraries\\net\\java\\jinput\\jinput\\2.0.5\\jinput-2.0.5.jar;%APPDATA%\\.minecraft\\libraries\\net\\java\\jutils\\jutils\\1.0.0\\jutils-1.0.0.jar;%APPDATA%\\.minecraft\\libraries\\com\\google\\code\\gson\\gson\\2.2.2\\gson-2.2.2.jar;%APPDATA%\\.minecraft\\libraries\\org\\lwjgl\\lwjgl\\lwjgl\\2.9.0\\lwjgl-2.9.0.jar;%APPDATA%\\.minecraft\\libraries\\org\\lwjgl\\lwjgl\\lwjgl_util\\2.9.0\\lwjgl_util-2.9.0.jar;%APPDATA%\\.minecraft\\versions\\1.6.2\\1.6.2.jar\" net.minecraft.client.main.Main --username playername --session token:****:**** --version 1.6.2 --gameDir \"%APPDATA%\\.minecraft\" --assetsDir \"%APPDATA%\\.minecraft\\assets\"";
try
{
Process p=Runtime.getRuntime().exec(authCode, null, new File("C:\\Program Files\\Java\\jre7\\bin"));
p.waitFor();
BufferedReader reader=new BufferedReader(new InputStreamReader(p.getInputStream()));
String line=reader.readLine();
while(line!=null)
{
System.out.println(line);
line=reader.readLine();
}
}
catch(IOException e1) {}
catch(InterruptedException e2) {}
System.out.println("Done");
}
When it gets issued and I start the .jar, the jar just remains blank and Minecraft doesn't appear or anything.