Below if condition is not working properly. Please advise.
I have java process id , but below working "No process alive". Why if [ -z $PIDS ] not working ?

```
PIDS= pgrep -f java

if [ -z "$PIDS" ]
then
echo "No process alive...."
exit 1
else
echo "An instace is running in background."
fi

```