There aren't any properties in the manifest specifications that you can use to control heap space. Instead, you can write a launcher main method in your application that executes a second process with your real main method using one of the Runtime.exec
implementations. Since you have access to the java.home system variable, you can use the version of Java that's running your launcher to also launch your game.
// Fix to use the version appropriate to the OS
String javaPath = System.getProperty("java.home") + "\bin\java.exe";
Runtime.exec("\"" + javaPath + "\" mygame.jar <heap_args>");
Using java.home
to get the Java path avoids path issues. This will also give you control over launching in the future if you decide to change how your program is launched. For example, this can be changed to use Process
so that you can also wait for the process to terminate in your launcher, giving you control over post-run cleanup when the game's JVM is fully terminated.