1

I'm trying to develop a desktop application that allows user to launch some of the applications (iTunes, terminal, calculator...) of Mac OSX using Java. I am new to OSX and I don't really know how the file system of the mac OSX works. I used

Runtime.getRuntime().exec("/usr/bin/open -a Terminal");

in order to execute terminal, but I ended up with no luck. I would really appreciate if anyone can help me solve this problem.

PS. if anyone has any idea on how to close the application that would be a great help.

I've attached the details of the system I'm working on. Details of my system

Sam
  • 59
  • 7

1 Answers1

1

Well, that's almost right, except that "open" expects to be passed the full name of the application, like iTunes.app.

this works:

public class HelloWorldApp {
    public static void main(String[] args) throws Exception{
    Runtime.getRuntime().exec("/usr/bin/open -a iTunes.app");
    }
}
Mark Bessey
  • 19,598
  • 4
  • 47
  • 69