Hello ,
I have an executable file written using Vc++ ,i want to call it in my java program in such a way it should get executed and should start working
Is it possible if so please suggest me relative links and process how to do
I think the Runtime class encompasses the execution of native code. Runtime.getRuntime().exec("notepad.exe"); for example runs the notepad. Remember that either the exe is in the PATH or give complete path to it.
This exec() method returns a Process object through which you can have more control like killing the process itself.
The following is a sample program.
And Miles to go before I sleep<br />And Miles to go before I sleep
The java.lang.ProcessBuilder class makes it easier, but it simplifies the problems discussed in the Daconta article Rob quoted. You still must read it.
subject: Can we call an executable(.exe) from Java program