my java code runs a main method that throws exit code.
How can I catch that exit code and not stop the runtime?
ConfigValidator.main(new String[] {"-dirs", SdkServiceConfig.s.PROPERTIES_FILE_PATH});
I thought to use
ProcessBuilder builder = new ProcessBuilder(commands);
Process process = builder.start();
int waitFor = process.waitFor();
int a = process.exitCode()
but how can i run this to run java code?
I cannot change the code inside the "main" method