简体   繁体   中英

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

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 ( ) ;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM