How to launch jar the same way Jar Launcher does The source of this problem is that Jar Launcher (/System/Library/CoreServices/Jar\ Launcher.app) runs the jar just perfectly (as far as I know, the Jar Launcher app is the one that runs jars which you double click in finder), but I need to set a memory buffer limits.

So I've tried to run the jar like:

java -Xms1024m -Xmx2048m -jar &lt;path_to_jar&gt;


And when I run a jar like this, I get an exception:

Exception in thread "Thread-11" java.lang.NoSuchMethodError: net.minecraft.Util.excutePost(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;


Do you have any idea what can be wrong with me launching app the way described above? Can you suggest any way to launch the jar like the Jar Launcher does or how to specify memory buffer limits for Jar Launcher?

EDIT

My console java version is:

java -version
java version "1.6.0_33"
Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720)
Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)


But I have no idea how to find out what version is Jar Launcher using
The problem is that you need to specify the class paths with the cp option to java and the library paths with the D option. The Minecraft launcher under /Applications handles this if you have a default install.  If you want to run the default configuration from the commandline, just run something like the following with the memory values of your choosing:

java -Xmx2048M -Xms512M -jar \
/Applications/Minecraft.app/Contents/Resources/Java/MinecraftLauncher.jar


Here's an example of how I run Minecraft from the command-line for ad-hoc mode.  I put the following in a script, name it and run it by name:

MCHOME="$HOME/Library/Application Support/minecraft/bin"
CP="$MCHOME/minecraft.jar:$MCHOME/lwjgl.jar:$MCHOME/lwjgl_util.jar:$MCHOME/jinput.jar"

java -Xmx2048M -Xms512M -cp "$CP" \
    -Djava.library.path="$MCHOME/natives" \
    net.minecraft.client.Minecraft