Home TechnologyProgrammingJava Subscribe to RSS

How We Can Run The Program Of C++ In Java....?

If we make the program in c++ and we want execute it in java.so what's the logic of executing c++ program in java?

Answer Question

1 Answer - Sort by: Date | Rating

    Any executable file can be run from a Java program using the following code :-
    Process p =    Runtime.getRuntime() .exec("rundll32 url.dll,FileProtocolHandler  filename");
    p.waitFor();
       Here the waitFor is to wait till the exe files exits.This execution using rundll is used in windows.
    Instead of  filename,write your location of the file(like "C:sample.exe").
    0 0

    Nlgopi 

    answered 7 months ago

    Hey can i put a class or method in the c++ program to make it a java program.?pls help
    Report
    Kokila1986

    Kokila1986

    commented 19 hours ago

      More

         
         

        Ask a Question via Twitter

        Send a question to @askblurtit and we will publish it online and send you a reply everytime you receive an answer.

        Blurtit Store

        Get T-shirts, hoodies, caps and more at the Blurtit store

        Blurtit International