I am trying to create a jar file that will execute my game with just a click. My game exceeds java's default allocated heap memory so I have to run my code with -Xmx1000m. I've been researching online and unfortunately there doesn't seem to be a way to tell a jar file to fun my code with more than the default memory. Instead I created another class that will use runtime to compile my code from within another main method and created a jar file using this:
import java.io.*;
public class RuntimeExec{
public static void main(String[] args){
try
{
Process process = Runtime.getRuntime().exec("java -Xmx1000m Controller");
process.waitFor();
int exitCode = process.exitValue();
if(exitCode == 0) { /* success*/ }
else { /*failed*/ }
}
catch (Exception e)
{e.printStackTrace();}
}
}
This works however I think it only works because it runs my existing class in the folder and not the one I stored in the jar. Is there a way so that the jar will run a class within in or combine two different jars that will allow me to get around the memory heap problem?