Skip to content

Instantly share code, notes, and snippets.

@bchetty
Created May 31, 2013 21:19
Show Gist options
  • Save bchetty/5688091 to your computer and use it in GitHub Desktop.
Save bchetty/5688091 to your computer and use it in GitHub Desktop.
Simple Java program to execute Mac-OS commands (For Ex: To open a Finder Window) through a Java program.
import java.io.IOException;
/**
* Simple Java program to execute Mac-OS command (For Ex: To open a Finder Window) through a Java program.
*
* @author Babji, Chetty
*/
public class Run {
public static void main(String[] params) throws IOException {
Runtime.getRuntime().exec(new String[] {"open", params[0]});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment