Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to set the return code

807603Nov 19 2007 — edited Nov 20 2007
Hello

I would like to set the return code (or exit code) from my Java application, and I found System.exit as the way

System exit also terminates all threads and exists the virtual machine, but I would like a rather "normal" way to return a code
to the native OS or to the calling application.

Is there another way to do this, like a return from main ? I am a C++ programmer and I am surprized to find that in Java
it is not so easy for an application to return the code to the caller.

Thank you,
Timothy Madden,
Romania
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 18 2007
Added on Nov 19 2007
111 comments
743 views