I have a C# app that runs a jar file and uses the System.exit code as a return value. A console window is displayed as a part of this jar, and if the user closes it (thereby terminating the jar) it returns an exit code of 143. The problem is that 143 (or any positive integer) could be a valid exit code if the jar completes successfully.
I need a way to manually set the System.exit code to a negative integer. Treating 143 as an exception in the C# app is out of the question.