java 启动打包成jar的应用程序 Runtime 用法
java实现启动 jar应用程序主要代码如下:String str="D:\\cs.jar\n";byte[] b=str.getBytes();Process p=Runtime.getRuntime().exec("C:\\WINDOWS\\system32\\cmd.exe");OutputStream out=p.getOutputStream();out.write(b);out.flush();字符串str 为 jar应用程序的文件名(含路径) 结尾必须加回车换行符“\n”此启动方法相当于在windows cmd.exe窗口中直接输入字符串str内容的运行效果上传文件时测试类和测试jar