#!bin/sh
VER=/tmp/jvm_ver.txt
cat <<-END
Product X needs java 1.4 to run properly.
END
OLD_IFS=$IFS
IFS=:
for dir in $PATH ; do
   IFS=$OLD_IFS
   jvm=$dir/java
   if test -f $jvm ; then
       $jvm -version > $VER 2>&1
       echo grep -q '1.4' $VER
       grep -q '1.4' $VER
       if test $? -eq 0 ; then
           break
       fi
   fi
   unset jvm
done
if test X$jvm != X ; then
   echo "Configured to use $jvm as the JVM"
else
   echo "Could not find a suitable JVM. Exiting install"
   exit 1
fi

# Now we save $jvm to a config file somewhere and proceed with the install
