import java.io.*;
public class B
{
public static void main(String args[])
{
try{
Runtime.getRuntime().exec("cmd.exe /c javac C:\\Documents and Settings\\Administrator\\桌面\temp\\A.java");}catch(IOException e1){}
try{Thread.sleep(5000);}catch(InterruptedException e){}
try{Runtime.getRuntime().exec("cmd.exe /c java C:\\Documents and Settings\\Administrator\\桌面\\temp\\A");}catch(IOException e2){};
System.out.println("111");
}
}
A.java手动可以正常编译后运行,为什么将B编译运行后,对A.java没有作用,既不能编译也不能运行处
public class B
{
public static void main(String args[])
{
try{
Runtime.getRuntime().exec("cmd.exe /c javac C:\\Documents and Settings\\Administrator\\桌面\temp\\A.java");}catch(IOException e1){}
try{Thread.sleep(5000);}catch(InterruptedException e){}
try{Runtime.getRuntime().exec("cmd.exe /c java C:\\Documents and Settings\\Administrator\\桌面\\temp\\A");}catch(IOException e2){};
System.out.println("111");
}
}
A.java手动可以正常编译后运行,为什么将B编译运行后,对A.java没有作用,既不能编译也不能运行处
解决方案 »
- java代码中生成大量的new File()对象,对程序有不好的影响吗?
- 装好MyEclipse7.1后,发现 configuration里 缺少文件夹
- 列出101到200以内所有的质数出现问题
- jdbc链接oracle取数据不正常-
- Bean这个规范的一个牢骚,大家给个答复
- 我想把JComBox中的要显示的文件,从poperties文件中读取出来显示?也就是如何读取propeties文件呢?
- 一个换码符“\”的问题
- 请问怎么样配置jdbc连接SQL数据库,给个例子更好!!
- 请问IntelliJ IDEA怎么配置?
- 菜鸟的问题
- 求助——DNS代理服务器问题
- 请教java中关于exec调用cmd的问题
temp前边的单引号可以吗?
Runtime.getRuntime().exec(new String[] {"cmd.exe", "/c", "javac", "C:\\Documents and Settings\\Administrator\\桌面\temp\\A.java"});