Details
Description
5 years ago, when I added shellcheck support to our build in the scope of KNOX-1816, I introduced a bug in the findJava function in knox-functions.sh: when $JAVA_HOME is not set, and Java is not available on the path, the function tries to find java executables under /usr. However, the current implementation is wrong:
$ which java /usr/bin/which: no java in (/usr/lib64/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin) $ echo $JAVA_HOME $ bin/knoxcli.sh export-cert --type JKS Warning: JAVA is not set and could not be found. ...