The following program allows you to run / execute other application from Java using the Runtime.exec()
method.
package org.kodejava.lang;
import java.io.IOException;
public class RuntimeExec {
public static void main(String[] args) {
//String command = "/Applications/Safari.app/Contents/MacOS/Safari";
String command = "explorer.exe";
try {
Process process = Runtime.getRuntime().exec(command);
} catch (IOException e) {
e.printStackTrace();
}
}
}
Latest posts by Wayan (see all)
- How do I create a servlet filter to make secure cookies? - April 18, 2024
- How do I configure secure cookies using web.xml? - April 18, 2024
- How do I create a table with multiple header in iText 8? - March 16, 2024