Reputation: 59
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.
Upvotes: 1
Views: 79
Reputation: 19782
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");
}
}
Upvotes: 1