How to open exe in java
In java, RunTime.getRuntime().exec() implements the call Server command scripts are required to perform functions.
Usage: (Recommended tutorial: java tutorial)
public Process exec(String command)-----在单独的进程中执行指定的字符串命令。 public Process exec(String [] cmdArray)---在单独的进程中执行指定命令和变量 public Process exec(String command, String [] envp)----在指定环境的独立进程中执行指定命令和变量 public Process exec(String [] cmdArray, String [] envp)----在指定环境的独立进程中执行指定的命令和变量 public Process exec(String command,String[] envp,File dir)----在有指定环境和工作目录的独立进程中执行指定的字符串命令 public Process exec(String[] cmdarray,String[] envp,File dir)----在指定环境和工作目录的独立进程中执行指定的命令和变量
1. First, call the application that comes with the windows system
Then put it in main as a test, run the java file, that is, open Notepad The application
2. The second method directly uses the local full path to run. Take the application as shown in the figure as an example. This is its startup program. Directory path
and then use the line of code shown in the figure to execute. In fact, the difference from the first method is whether the full path of the file that needs to be started is required.
3. The last method is to use the String[] array to pass parameters to start the application
In this way, the specified file will be opened with notepad.
The above is the detailed content of How to open exe file in java. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

WebStorm Mac version
Useful JavaScript development tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Notepad++7.3.1
Easy-to-use and free code editor
