Win a copy of Clojure in Action this week in the Clojure forum!
    Bookmark Topic Watch Topic
  • New Topic

Returning error code from jar application

 
Makesh Kumar Ramakrishnan
Ranch Hand
Posts: 88
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
I am not sure, you came across the similar situation or there is a solution for this problem.

I need to return an error code from my jar application to the calling application. This jar application does some core java functionality and if it finds any unusal situation while executing the code, then it returns with the error code to the calling function. The calling function may be a unix shell script.

Can I use System.exit(n) to return the error code? Can this return value be received by the calling function? Please let me know your answers

Thanks,
Makesh
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not crosspost.
Thanks.

http://www.coderanch.com/t/327972/java/java/Returning-error-code-jar-application
 
Makesh Kumar Ramakrishnan
Ranch Hand
Posts: 88
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
I am sorry. I don't know the exact level of difficulty of the question. that's why i posted in both forum.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
I think that you can check the status code returned by System.exit in Unix, using an environment variable.
It may depend on the shell (I don't remember), but I think you can get it with $?
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Report post to moderator
CLosing, continue in the other copy.
 
I agree. Here's the link: http://aspose.com/file-tools
    Bookmark Topic Watch Topic
  • New Topic