How do you return an exit code from Rhino?
Asked Answered
A

2

8

I'm using java to run a command line utility written in Rhino but if there is an error I need to return that error back to the shell so processing stops. How do I pass back an error code from Rhino to the shell?

Almaraz answered 25/6, 2009 at 7:42 Comment(0)
E
8

you could use

java.lang.System.exit(1);
Exodontics answered 25/6, 2009 at 7:58 Comment(0)
M
0

Executing java.lang.System.exit(1) may produce unexpected results such as entire environment or application quitting (e.g. HPOO).

Montero answered 28/8, 2012 at 15:13 Comment(2)
just noting an unexpected behavior as HPOO uses rhino and calling the above will kill the entire studio environment. It won't even bother asking you to save your workflows if there are outstanding changes.Montero
I still think this answer should've been a comment on the other answer.Disconcerted

© 2022 - 2024 — McMap. All rights reserved.