Before Creating the Enhancement Request
Summary
runbroker.sh and runserver.sh ignore user set JAVA_HOME on Linux, always overriding it with which javac result. This was already fixed in tools.sh (#7786), but these two scripts were not updated.
Motivation
This issue was already fixed in tools.sh (#7786), but runbroker.sh and runserver.sh were not updated. Users deploying on Linux with a custom JAVA_HOME may silently get the wrong JDK.
Describe the Solution You'd Like
Move the JAVA_HOME check before the case statement in find_java_home(), consistent with tools.sh.
Describe Alternatives You've Considered
No. The proposed fix aligns with the existing approach already adopted in tools.sh.
Additional Context
No response