• Post Reply Bookmark Topic Watch Topic
  • New Topic

System.exit() question  RSS feed

 
nirjari patel
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Perl script. which calls jar file as follows
This jar fail has main() in a class, fragment of this class is as follows.Does System.exit(1) return 1 , if Exception occurs ? OR it just exits the system ?
What value will be received by $retval which is a variable in script calling this class ?
Thanks
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is easy to test, is it not?
 
Campbell Ritchie
Marshal
Posts: 56534
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you using System.exit() at all? It is a bit vicious; if you are in a threaded environment it may terminate threads which are partway through a task, leading to corrupt data.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!