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

 

相关文章:

  • 2021-05-12
  • 2021-05-22
  • 2021-12-06
  • 2021-12-15
  • 2021-11-19
  • 2021-07-19
  • 2021-12-16
猜你喜欢
  • 2021-08-08
  • 2021-11-09
  • 2021-05-21
  • 2021-07-16
  • 2021-11-29
  • 2021-12-03
  • 2021-04-22
相关资源
相似解决方案