4 Replies Latest reply on Aug 22, 2016 8:26 AM by Sarah Qu

    Bootstrap Wildfly - shutdown the Wildfly server / kill JAVA process

    Sarah Qu Newbie

      Dear all,


      I saw the following project to start the server from a Main - Methode:



      Now I would like to stop also the server.

      How can I do this?


      I tried already this:


        public static void main(final String[] args) throws Exception {
       String currentPath = System.getProperty("user.dir");
       File currentFilePath = new File(currentPath).getParentFile();
       String pathForServer = currentFilePath.getAbsolutePath()
       + File.separatorChar + "service" + File.separatorChar
       + "server";
       final ServerBuilder builder = ServerBuilder.builder().setJbossHome(
        final Server server = builder.build();
      while (server.getState() == State.STARTED) {


      But this will not kill the JAVA process. How can I do this?