Forum Stats

  • 3,752,275 Users
  • 2,250,483 Discussions
  • 7,867,774 Comments

Discussions

Java8: application calling getRuntime.exec(params) that now never ends or dies

1044511
1044511 Member Posts: 7
edited Oct 22, 2014 7:04AM in Generics

Hello,

I have an Application that is a process that does some things and after all launches another application and it ends. With previous Java versions (including Java 7) it worked properly: it launched the other application and then it finished.

Now, with Java 8, it does never die. It reaches its finish, but never closes the process. It's something like this:

public static void main(String[] args) {

  try {

     (...)

     Process p = Runtime.getRuntime().exec(params);

       } catch (Exception e) {

            log.error(getStackTrace(e));

       }

       finally

       {

            LogManager.shutdown();

       }

  System.out.println("DEAD");

  }

It writes this "DEAD" but it does not die. So, it finishes if instead of this System.out I do a System.exit(0);, but I don't like the solution.

What has changed in this last Java version regarding to rhis getRuntime().exec(params)? Is there anything new or something that it has to be done?

Thanks in advance,

Xabier

This discussion has been closed.