$JAVA_HOME/bin/java" -classpath "$NEW_CLASSPATH" myclassfile & echo $! > /tmp/java.pid
You can then write a kill script:
#!/bin/sh PIDFILE=/tmp/java.pid
echo 'Killing Java process from PID file'
if [ -f $PIDFILE ] ; then
PID=`cat $PIDFILE`
kill -3 $PID
if kill -9 $PID ; then
echo "java process stopped"
else
echo "java process could not be stopped"
fi
rm -f $PIDFILE
fi
so you killed it but where did you start it again iwth the same PID? I
couldn't get this..
No, you don't start it again with the same PID.