执行程序代码,打包war文件~~

来源:互联网 发布:网络信息公司经营范围 编辑:程序博客网 时间:2024/06/15 16:02

try{  
  string strjavahome = system.getproperty("java.home");  
  strjavahome = strjavahome.substring(0,strjavahome.lastindexof(//))+"//bin//";  
  runtime.getruntime().exec("cmd /c start "+strjavahome+"jar cvf hello.war c://tomcat5.0//webapps//root//*");  
  }  
catch(exception   e){system.out.println(e);}

原创粉丝点击