When running agent as security mode, they uses JAVA_HOME env var to allow local file access to JAVA directories.
If it did not set, it would stop the agent execution. However it show no error message.
A user might be surprised by this and might not know how to fix this.
It's necessary to show error message when it's not provided.