無味
发布于 2015-04-23 / 2 阅读
0

WAR包-243573295

 

1.windows命令下使用cmd命令打包

jar -cvf applicationname.war package.*;

 

2.程序中使用代码打包(这里用java)

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);}