66182

Question:
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
Answer1:If I understand the question and comments correctly, then you want to use something like <a href="http://download.oracle.com/javase/7/docs/api/java/lang/Runtime.html#exec%28java.lang.String%29" rel="nofollow">Runtime.exec(String)</a>.
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 ( ) ;