Installing OpenNMS and had a bit of a snag. Issue resolved but it left me wondering...
Why doesn't this work:
[nac@localhost /]$ cd opt/opennms/bin/
[nac@localhost bin]$ runjava -s
-bash: runjava: command not found
...but this does:
[nac@localhost /]$ opt/opennms/bin/runjava -s
runjava: Looking for an appropriate JRE...
runjava: Checking for an appropriate JRE in JAVA_HOME...
runjava: skipping... JAVA_HOME not set
runjava: Checking JRE in user's path: "/usr/bin/java"...
runjava: found an appropriate JRE in user's path: "/usr/bin/java"
I'm using cygwin. ssh into a fedora box. the output is green for ls /opt/opennms/bin
if that helps...
.
(current directory) is not a path the shell looks for executables in; https://unix.stackexchange.com/questions/65700/is-it-safe-to-add-to-my-path-how-come explains why. – derobert Sep 22 '17 at 16:32.
to$PATH
. – Kusalananda Sep 22 '17 at 16:32runjava
from the directory it's in doesn't work (presumably compared to Windows/DOS where it does work)..
not being in the path is the reason. That question explains why.
is not in the path. – derobert Sep 22 '17 at 16:34