Minecraft – Is this the correct Java command for Minecraft

minecraft-java-edition

I wanted to run Minecraft and tell it to use more RAM than whatever its default is, the purpose was to decrease loading times when entering new biomes and the like.

I saw, when using the name command given to me in this question's answer by Tobias, that part of the line had a section for memory (-Xms -Xms).

java -Xms2048m -Xmx2048m -cp "%APPDATA%\.minecraft\bin\*" -Djava.library.path="%APPDATA%\.minecraft\bin\natives" net.minecraft.client.Minecraft "yournamehere"

However, I wanted a command that allowed me to change the maximum memory, without skipping the login process. I searched Gameing.SE for Minecraft-Memory questions and found this question which had a nice line of code in an answer that was stated to improve Minecraft performance.

"C:\Program Files\Java\jre6\bin\java" -Dsun.java2d.noddraw=false -Dsun.java2d.d3d=true -Dsun.java2d.opengl=false -Xms2048M -Xmx2048M -jar "C:\minecraft.jar"

Now my minecraft.jar file isnt sitting naked in my C: drive to my knowledge, and also I dont seem to need the full directory path to java, or else the first command I annotated wouldnt work. So what I came up with is this:

java -Dsun.java2d.noddraw=false -Dsun.java2d.d3d=true -Dsun.java2d.opengl=false -Xms2048M -Xmx2048M -jar "C:\Users\Ender\Desktop\Minecraft.exe"

When I run it, my Minecraft.exe file runs properly (it seems) and I can login (or attempt to anyway if my internet is being difficult) but I have no idea if the command is actually working as I intended it to. Is this command right? Or is it wrong and just seems as if it's right?

Best Answer

I think it's ok, but many of the tutorials and stuff uses javaw.exe instead of java.exe, the first one looks a little bit weird with %APPDATA%.minecraft\bin*, and I think you should use full path to java just for safety, try this:

"C:\Program Files\Java\jre6\bin\javaw.exe " -Dsun.java2d.noddraw=false -Dsun.java2d.d3d=true -Dsun.java2d.opengl=false -Xms2048M -Xmx2048M -jar "C:\Users\Ender\Desktop\Minecraft.exe"

The difference between java.exe and javaw.exe is that javaw.exe don't have console window attached to it.

With java.exe you get this little Java window everytime you open Minecraft, and it can get pretty annoying. You can use it for debugging though, with all this stuff, info etc.

I think you can also do it with launcher, using -cp instead of -jar, and net.minecraft.LauncherFrame, but I don't know if it still work in-game, or it only changes launcher setting without purpose.

Also, is your system 64-bit? I don't know if it's better, but I am using Java 7 instead of 6, and maybe it's placebo effect, but I think it works little bit better, so you could try it too.

By the way, my friend noticed, that Minecraft still don't want so much memory after all, because even with Sonic's Shader Mod, it was taking only 1.6 GB from 4 GB available.

I don't know if it's even worth to try all of this, when it probably won't change anything.

If you aren't using it already, I would recommend you OptiFine, that really works and helps with framerate and graphics.

http://www.minecraftforum.net/topic/249637-11-optifine-hd-a4-fps-boost-hd-textures-aa-af/