4 Replies Latest reply on Jul 1, 2013 1:01 PM by BIJ001

    kill java vm with Runtime


      Hello All,


      I m trying implement something funny in my web site.

      what I would like to do is to let anyone shut down the server if someone send a message to the site.

      I tried the code below in a java se app and fedora. it did run, but didn't kill the java process.

      Could someone point out if I miss anything?

      Thank you.





              String stopCmd = "ps -ef | grep java | xargs kill";
              Runtime rt = Runtime.getRuntime();