Iso
Iso

Reputation: 3758

Execute Makefile using Java command?

I'm just wandering. Is there a possibility to execute makefile.in using a Java command? Something like what you can do with Java and Ant.

Thanks

Upvotes: 0

Views: 1641

Answers (1)

emory
emory

Reputation: 10891

If I understand the question and comments correctly, then you want to use something like Runtime.exec(String).

String command = "make stuff" ; the make command you wish to run
String [] envp = { } ; if you want to set some environment variables
File dir = new File ( "/home/me/" ) ; // this is the directory where the Makefile is
Process proc = Runtime.getRuntime().exec(command,envp,dir);
proc.waitFor ( ) ;

Upvotes: 4

Related Questions