How to run external application from java

Java Runtime that allows the application to interface with the environment in which the application is running. The getRunTime().exec() method allows to execute external application from java.

Example

package com.pretech;
import java.io.IOException;
public class JavaRunTimeExample {
	public static void main(String[] args) {
		try {
			Runtime.getRuntime().exec("notepad.exe c:/pretech.txt");
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}

Output



image


No comments:

Post a Comment

Confusion Matrix + Precision/Recall (Super Simple, With Examples)

  Confusion Matrix + Precision/Recall (Super Simple, With Examples) 1) Binary Classification Setup Binary classification means the model p...

Featured Posts