CSDN网友fishyqd:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class CSDN6 {
public static void main(String[] args)
{
Runtime rt = Runtime.getRuntime();
try {
Process p= rt.exec("cmd /c echo \"%CATALINA_HOME%\"");
BufferedReader in= new BufferedReader(new InputStreamReader(p.getInputStream()));
String path = in.readLine();
System.out.print(path);
} catch (IOException e) {
e.printStackTrace();
}
}
}
发表于 @ 2006年09月12日 14:31:00|评论(loading...)|编辑