Can someone tell me why this simple command cannot find the output "java version"?
if java -version | grep -q "java version" ; then
echo "Java installed."
else
echo "Java NOT installed!"
fi
output from java -version
is as follows
java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)