Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

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

1044511Oct 22 2014 — edited Oct 22 2014

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

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 19 2014
Added on Oct 22 2014
0 comments
1,382 views