使用Java命令执行Makefile? [英] Execute Makefile using Java command?
本文介绍了使用Java命令执行Makefile?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我只是在流浪.是否有可能使用Java命令执行makefile.in?类似于您可以使用Java和Ant进行的操作.
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.
谢谢
推荐答案
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 ( ) ;
这篇关于使用Java命令执行Makefile?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文