Java (Minecraft) doesnt start from c# -
when copy paste javaw.exe -arguments console works but, when launch doesn't work.
string directory = "c:\\users\\can\\appdata\\roaming\\.minecraft"; string java = @"c:\windows\system32\javaw.exe"; string javalocation = "c:\\program files\\java\\jre7\\bin\\javaw.exe"; string ram = "1g"; string username = "namehere"; string token = "--session token:"+tokengenerated; string version = "1.6.2"; string launch = "-xmx" + ram + " -djava.library.path={0}\\versions\\1.6.2\\1.6.2-natives-7453523379463 -cp {0}\\libraries\\net\\sf\\jopt-simple\\jopt-simple\\4.5\\jopt-simple-4.5.jar;{0}\\libraries\\com\\paulscode\\codecjorbis\\20101023\\codecjorbis-20101023.jar;{0}\\libraries\\com\\paulscode\\codecwav\\20101023\\codecwav-20101023.jar;{0}\\libraries\\com\\paulscode\\libraryjavasound\\20101123\\libraryjavasound-20101123.jar;{0}\\libraries\\com\\paulscode\\librarylwjglopenal\\20100824\\librarylwjglopenal-20100824.jar;{0}\\libraries\\com\\paulscode\\soundsystem\\20120107\\soundsystem-20120107.jar;{0}\\libraries\\argo\\argo\\2.25_fixed\\argo-2.25_fixed.jar;{0}\\libraries\\org\\bouncycastle\\bcprov-jdk15on\\1.47\\bcprov-jdk15on-1.47.jar;{0}\\libraries\\com\\google\\guava\\guava\\14.0\\guava-14.0.jar;{0}\\libraries\\org\\apache\\commons\\commons-lang3\\3.1\\commons-lang3-3.1.jar;{0}\\libraries\\commons-io\\commons-io\\2.4\\commons-io-2.4.jar;{0}\\libraries\\net\\java\\jinput\\jinput\\2.0.5\\jinput-2.0.5.jar;{0}\\libraries\\net\\java\\jutils\\jutils\\1.0.0\\jutils-1.0.0.jar;{0}\\libraries\\com\\google\\code\\gson\\gson\\2.2.2\\gson-2.2.2.jar;{0}\\libraries\\org\\lwjgl\\lwjgl\\lwjgl\\2.9.0\\lwjgl-2.9.0.jar;{0}\\libraries\\org\\lwjgl\\lwjgl\\lwjgl_util\\2.9.0\\lwjgl_util-2.9.0.jar;{0}\\versions\\1.6.2\\1.6.2.jar net.minecraft.client.main.main --username " + username + " " + token + " --version " + version + " --gamedir {0} --assetsdir {0}\\assets"; launch = string.format(launch, directory); string text = launch; // writealltext creates file, writes specified string file, // , closes file. directory.setcurrentdirectory(@"c:\windows\system32\"); process.start("javaw.exe", path.combine(launch)); what doing wrong?
why need call path.combine if whole path in 1 string?
assuming javaw.exe in c:\windows\system32\, process.start("java.exe", launch); should work intended.
source - path on msdn: http://msdn.microsoft.com/en-us/library/system.io.path.aspx
Comments
Post a Comment