java运行可以执行文件

# package com.yymt.pf.rpc.loadbalance;  
#   
# import java.io.File;  
# import java.io.IOException;  
#   
# public class ExecFileUtil {  
#     public static void main(String[] args) throws IOException {  
#         run("cmd /C start startup.bat", null, new File(  
#                 "E:\\develop_tools\\apache-tomcat-6.0.26\\bin\\"));  
#         System.out.println("Started!");  
#     }  
#   
#     /** 
#      * @param path 
#      *            a specified system command 
#      * @param envp 
#      *            array of strings, each element of which has environment 
#      *            variable settings in the format name=value, or null if the 
#      *            subprocess should inherit the environment of the current 
#      *            process. 
#      * @param dir 
#      *            the working directory of the subprocess, or null if the 
#      *            subprocess should inherit the working directory of the current 
#      *            process. 
#      * @return 
#      * @throws IOException 
#      */  
#     public static Process run(String cmd, String[] envp, File dir)  
#             throws IOException {  
#         Runtime rt = Runtime.getRuntime();  
#         return rt.exec(cmd, envp, dir);  
#     }  
#   
# } 
 
原文地址:https://www.cnblogs.com/qq1988627/p/6606876.html