« Return to Thread: [Q] how can I start a shell process and return immediately?

Re: [Q] how can I start a shell process and return immediately?

by Cameron Matheson-2 :: Rate this Message:

Reply to Author | View in Thread

Hello,

On 9/28/07, Stephen Bannasch <stephen.bannasch@...> wrote:
> I want to start a Java program from a Ruby program and have the Java
> program run in another process and have control returned to my Ruby
> program as soon as the Java process starts up successfully.
>
> When I try this from a Ruby program the program blocks until the Java
> program is terminated.

There may be another way, but the first thing that came to mind for me
was just to launch it in another thread:

Thread.new { `java -cp <classpath> <main_class>` }

Cameron

 « Return to Thread: [Q] how can I start a shell process and return immediately?