Java threads problem

Posted by MyNameIs on Stack Overflow See other posts from Stack Overflow or by MyNameIs
Published on 2010-03-17T14:49:20Z Indexed on 2010/03/17 14:51 UTC
Read the original article Hit count: 223

Filed under:
|

Hi!

I have a problem with java threads:

public class MyClass{

public void Core(){ runTools(); //here I would like to call runTools() method }

public void runTools(){

final String run_tool ="cmd.exe /C sources.exe";

Runnable doRun = new Runnable() { public void run() { try { Process tool_proc = Runtime.getRuntime().exec(run_tool); } catch (IOException e) { e.printStackTrace(); } } }; Thread th = new Thread(doRun); th.start();

} }

If I do this, then I don't know why, but the thread doesn't work. Please give me some ideas to create a thread. I have already been seen lots of examples, but I should some code such as my example here. Thanks!

© Stack Overflow or respective owner

Related posts about java

Related posts about threads