Currently the java command is searched in the following locations under JAVA_HOME:
jre/sh/java - old IBM Java, at least on AIX
jre/bin/java no longer relevant since Jigsaw (Java >= 9)
bin/java - still used
bin/java is the only one currently used. Therefore Javapackages should look for java command only under ${JAVA_HOME}/bin/java and ignore the other two locations.