Exe executable file using Java calls using Java calls exe executable file

Exe executable file using Java calls

 Excerpt: https: //www.cnblogs.com/WittPeng/p/9394611.html

A starting point

  Weekdays, we saw a lot of executable file has been formed, and after a certain package. Because of open source, most of the time you can compile your own use eclipse, but also often encountered as a direct call more convenient circumstances. So this time, I personally need to use Java to call these outstanding executable file directly.

Second, practice and record

  Chose a software, it is the Chinese Academy of Sciences NLPIR-Parser, using java call it directly.

Copy the code
Open Package Penalty for; 

public class OpenEXE { 

        public static void main (String [] args) { 
        openExe (); 
        } 

        // call other executable files, for example: to produce their own exe, download software or install 
        public static void openExe () { 
        the Runtime Runtime.getRuntime RN = (); 
        Process P = null; 
        the try { 
        P = rn.exec ( "D: /BeTheBest/stitp/NLPIR-Parser/bin-win64/NLPIR-Parser.exe"); 
        } the catch (Exception E) { 
        System.out.println ( "Error Exec!"); 
        } 
        } 
        
}
Copy the code

After running, tips:

And later we found that the software runs directly in the eclipse also shows the error.

 

A starting point

  Weekdays, we saw a lot of executable file has been formed, and after a certain package. Because of open source, most of the time you can compile your own use eclipse, but also often encountered as a direct call more convenient circumstances. So this time, I personally need to use Java to call these outstanding executable file directly.

Second, practice and record

  Chose a software, it is the Chinese Academy of Sciences NLPIR-Parser, using java call it directly.

Copy the code
Open Package Penalty for; 

public class OpenEXE { 

        public static void main (String [] args) { 
        openExe (); 
        } 

        // call other executable files, for example: to produce their own exe, download software or install 
        public static void openExe () { 
        the Runtime Runtime.getRuntime RN = (); 
        Process P = null; 
        the try { 
        P = rn.exec ( "D: /BeTheBest/stitp/NLPIR-Parser/bin-win64/NLPIR-Parser.exe"); 
        } the catch (Exception E) { 
        System.out.println ( "Error Exec!"); 
        } 
        } 
        
}
Copy the code

After running, tips:

And later we found that the software runs directly in the eclipse also shows the error.

 

Guess you like

Origin www.cnblogs.com/LiuYanYGZ/p/11240234.html