Вопрос

I have a java program which uses Runtime.exec() to spawn a child process, but I need to be able to programatically suspend it and then start it running again from where it left off. The Java Process object doesn't seem to provide any way to do that. Does anyone know how I might accomplish this?

Thank you

Это было полезно?

Решение 2

Under UNIX you can Runtime.exec + kill -STOP and -CONT to suspend and resume a process, without using JNI.

Другие советы

Java is not a low level language. Thus, some interactions with the Operating System are not supported.

The only solution is for you to create your code using a language which can really work with the OS such C/C++ and call it from java using JNI.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top