I am trying to create a jar file that will execute my game with one click. My game exceeds the standard java heap memory, so I need to run my code with -Xmx1000m. I am studying online, and unfortunately it seems that there is no way to tell the jar file to make it amuse my code with more than default memory. Instead, I created another class that will use the runtime to compile my code from 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) { } else { } } catch (Exception e) {e.printStackTrace();} } }
This works, but I think it only works because it runs my existing class in a folder, and not the one I stored in the bank. Is there a way for the jar to run the class inside or combine two different jars that will allow me to get around the memory heap problem?
source share