String[] command = { "cmd.exe", "/C", "Start", "skype" };
Runtime runtime = Runtime.getRuntime();
Process process = runtime.exec(command);
Hello, I am trying to start skype in java! and i have this problem: I am using code above, In eclipse it works perfect but when i compile it into runnable jar it will stuck into infinite loop where new java processes are started until whole java crashes!
And the problem is in this part of code. (When i comment it everything works fine but skype is not started)
Where can be problem?
Edit*
I made small example of Program:
Main class:
package Client;
public class DemoMain {
public static void main(String[] args) {
new Demo();
}
}
Process class:
package Client;
import java.io.IOException;
public class Demo {
public Demo(){
try {
Runtime.getRuntime().exec(new String[]{ "cmd.exe", "/C", "Start", "skype" });
} catch (IOException e) {
e.printStackTrace();
}
}
}
Result: Task Manager view
In eclipse compiler it works great! Problem is when program is started from Runnable jar