package yy.test;
import java.io.*;
public class TestExec {
public static void main(String[] args) {
try {
String cmd[]={"C:\\Program Files\\Adobe\\Reader 8.0\\Reader\\AcroRd32.exe","E:\\books\\TechnologyResource\\JAVA\\spring-reference.pdf"};
Process p = Runtime.getRuntime().exec(cmd);
BufferedReader in = new BufferedReader(
new InputStreamReader(p.getInputStream()));
String line = null;
while ((line = in.readLine()) != null) {
System.out.println(line);
}
}
catch (IOException e)
{
e.printStackTrace();
}
}
}
用Java调用应用程序示例
最新推荐文章于 2022-10-12 22:40:41 发布