Your problem can be caused by a number of things, and there's also more than one way to solve it, I guess.
(1) Try setting environment variable:
export JAVA_HOME <install dir of JRE>
export PATH $JAVA_HOME:$PATH
(2) Create a softlink in a place included in your path.
Important: Run your command as user, not root. Root has a much shorter PATH, usually, than any other user, and can not normally do much with Java.