System.exit() doesn't return actual code

E

Eyal Bekerman

Hello,

I have a java application which uses Runtime.exec() to execute another
java application.
The child java application returns 18 on success and 19 on failure.
It works fine most of the times but at some computers it fails
occasionally, returning 0 to the parent application.
The last line in the main() method is System.exit()

What am I doing wrong?
 
R

Roedy Green

The child java application returns 18 on success and 19 on failure.
It works fine most of the times but at some computers it fails
occasionally, returning 0 to the parent application.
The last line in the main() method is System.exit()

I have seen strange numbers returned as well. There may be a bug to
track down.
 
S

Steven Coco

Eyal said:
Hello,

I have a java application which uses Runtime.exec() to execute another
java application.
The child java application returns 18 on success and 19 on failure.
It works fine most of the times but at some computers it fails
occasionally, returning 0 to the parent application.
The last line in the main() method is System.exit()

What am I doing wrong?

Does your application create any threads?

--

..Steven Coco.
.........................................................................
When you're not sure:
"Confess your heart" says the Lord, "and you'll be freed."
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top