I want to run an exe file in my project.
I mean when I run my codes,a specific executable file run.
How can I do that?

I want to run an exe file in my project.
I mean when I run my codes,a specific executable file run.
How can I do that?

you could also look at using a Runtime class of java:

import java.io.*;  
public class TestExec {  
    public static void main(String[] args) {  
        try {  
            Process p = Runtime.getRuntime().exec("cmd echo Hello World");  //calls cmd.exe and prints hello world to console
            BufferedReader in = new BufferedReader(  
                                new InputStreamReader(p.getInputStream()));  
            String line = null;  
            while ((line = in.readLine()) != null) {  
                System.out.println(line);  
            }  
        } catch (IOException e) {  
            e.printStackTrace();  
        }  
    }  
}
This question has already been answered. Start a new discussion instead.