File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes to run C program in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "to run C program in Java" Watch "to run C program in Java" New topic

to run C program in Java

Priya mathi

Joined: Nov 15, 2000
Posts: 4
in Linux i run C as ./<filename>
the same program i want to run from Java
In java i tried using exec("./filename>")
i did'nt get any response.
how should i run
Ravi Siva

Joined: Dec 03, 2005
Posts: 1

Ravi here... mail me at or MSN me at PLEASE!

I am software engeer... and I will help you. If you are Priya Mathibalan.
Thank you Priya.
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
The Java Intermediate FAQ links to an article that describes how to properly use Runtime.exec(). There are some aspects to it that are not obvious and often cause problems. But it works well in general.
I agree. Here's the link:
subject: to run C program in Java
jQuery in Action, 3rd edition