title: Check exit status of main
body: <p>I am invoking the main class of a .class contained in the same folder from my Java code. That main is void, and I want to check whether it was successful or not by checking its exit status:</p>
  
  <pre><code>    ...
      String[] arguments = new String[]{"a", "b"};
      AnotherClass.main(arguments);
      ...
  </code></pre>
  
  <p>Any idea on how, being that AnotherClass.main(arguments); does not return anything?</p>
  
  <p>Thank you.</p>