I use Linux and have noticed that jshell always exits with code 0 even if the java expression is invalid:
$ echo "invalid java expression" | jshell -
Error:
';' expected
invalid java expression;
^
$ echo $?
0
Is it possible to force it to exit with a non-zero code somehow? I've read the help but have found nothing about it.
Probably the easiest way is to run command '/exit' with proper argument.