File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Opening an external program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Opening an external program" Watch "Opening an external program" New topic

Opening an external program

Randy Miller
Ranch Hand

Joined: Feb 13, 2012
Posts: 44
Hi guys!

So,basically I am developing an application, working with XML. Now I am trying to figure out a way to open an external program on my laptop, in this case UltraEdit, via Eclipse, as soon as I click on a button in my GUI. And it would be even better if I knew how to directly open a file with this external program, cklicking on my button.
I searched for some time on the internet but I just couldn´t find the right solution.
Would be awesome if one of you could help ;)


Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3152

There have been similar queries here before, you can search for Runtime.getRuntime() And there another important article explaining the pitfalls of Runtime.exec().

You can also look at Apache Commons Exec API which wraps around the Java implementation.

Mohamed Sanaulla | My Blog
Randy Miller
Ranch Hand

Joined: Feb 13, 2012
Posts: 44
Hi Mohamed!

Thanks for your reply!I figured it out and it works just fine
Here,for everybody who´s interested:

I agree. Here's the link:
subject: Opening an external program
It's not a secret anymore!