hi everyone!

I have 2 applications, one coded in C++ and the other coded in java, i want to launch the one coded in c++ from the other one, honnestly i dont know how to do it at all
i use eclipse and VS2010

any ideas about that???

thank YOU very much for any help

Recommended Answers

All 7 Replies

thank you for your answer, i tryed to do it by this code but it doesn't work : this is my code

Runtime runtime = Runtime.getRuntime();
Process process = runtime.exec(new String[]{"Microsoft Visual C++ 2010 Express.exe", "readxmlresou.exe"}, null, new File("C:\\Users\\abdelhalim\\Desktop\\"));

the compiler get me this error :

Exception in thread "main" java.io.IOException: Cannot run program "MicrosoftVisualC++2010Express.exe" (in directory "C:\Users\abdelhalim\Desktop"): CreateProcess error=2,The specified file is not found

and im sur that i have "readxmlresou.exe" in that directory??????

Use ProcessBuilder, not Runtime.exec

commented: 5 +0

also: exception handling is great, but exception avoiding can help as well.
write a test that checks whether or not that file exists on your system, before trying to run it.

commented: 5 +0

hi everyone !

Thank YOU stultuske for your help but whene i use this code :

Process process = new ProcessBuilder("C:\\Users\\abdelhalim\\Desktop\\readxmlresou.exe").start();

i dosen't chow me any errors but also dosen't start the program!!!!!
do i miss any thing at all

Thank you again for your help

with just that bid of code, it's pretty hard to say.can you show a bit more?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.