When invoking the JVM with wrong arguments, I'd expect it to exit with an error code:
java -x && echo ok || echo Failed AS EXPECTED
Unrecognized option: -x
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Failed AS EXPECTED
Now, if I use another unrecognized argument, it does exit promptly, but it doesn't return an error code:
# Now that's a CAPITAL X
java -X 2>/dev/null && echo ok || echo Failed AS EXPECTED
ok
There is no error because -X (capital x) is a valid command line argument.
It makes Java print help on extra options to the error stream.