I saw a lot of questions about System.exit(int status) on stackoverflow .
For instance:
The difference in the system. exit (0), System.exit (-1), System.exit (1) in Java
difference between System.exit (0) and System.exit (-1)
But I do not see the answer to my partial question:
Do we have a direct connection between exit status and System Error Codes for Microsoft products ( Microsoft website )?
Of course, we do not have direct connections, but: can we establish this connection?
If we run our java program on Windows, and our java program has a System.exit(int status) statement, can we use System Error Codes list or not?
Is this a good idea or not?
What do you think about it? Any other ideas?
Example:
- The Java program was launched through the command line on the Wisdows OS;
- Our java program
FileNotFoundException exception, for example FileNotFoundException ; - After that, we decided to close our program using
System.exit(int state) ; - In this case, can
exit status be equal to 2 ?
because ( Microsoft Website ):
ERROR_FILE_NOT_FOUND 2 (0x2) The system cannot find the file specified.
source share