日期:2014-05-20  浏览次数:20598 次

在java程序中调用perl,怎么写?
如题,比如我想在java程序中调用
rsa_crypt.pl   -[e|d]   [“original   string“|   “encrypted   string”]
,该怎么写啊,盼高手指点一二!

------解决方案--------------------
String cmd = "rsa_crypt.pl -[e|d] [\ "original string\ "| ' "encrypted string\ "] ";
Process proc = Runtime.getRuntime().exec(cmd);
try {
proc.waitFor();
} catch (InterruptedException e) {}
int code = proc.exitValue();
------解决方案--------------------
关注这个问题
------解决方案--------------------
学习了,回去试试Runtime.getRuntime().exec(cmd);以前一直想知道Java中怎么调用系统命令或C语言代码,难道就是这样调吗?