java程序调用命令行
package test;
import java.util.*;
import java.io.*;
public class MediocreExecJavac
{
public static void main(String args)
{
try
{
Runtime rt = Runtime.getRuntime();
Process proc = rt.exec("C:““Program Files““FOUNDER““方正飞腾集成排版系统4.1““Fit.exe");
InputStream stderr = proc.getErrorStream();
InputStreamReader isr = new InputStreamReader(stderr);
BufferedReader br = new BufferedReader(isr);
String line = null;
System.out.println("ERROR");
while ( (line = br.readLine()) != null)
System.out.println(line);
System.out.println("/ERROR");
int exitVal = proc.waitFor();
System.out.println("Process exitValue: " + exitVal);
} catch (Throwable t){
t.printStackTrace();
}
}
}
:
| 广告合作:400-664-0084 全国热线:400-664-0084 Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号 珠峰网 版权所有 All Rights Reserved
|