Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to open user system "select program to open with" for given file?

807588Feb 11 2009 — edited Jun 4 2009
Hi,

I'm trying to make file management application in Java.

I already know how to open file in system preferred application. It's quite easy.

The other issue I thinking about now is that I need to implement "Open With" functionality (like in Ubuntu: you right press on the file -> select "Open With" -> "Other" and system's default application selection window starts.

I tried to manage that with some Java default classes, but I didn't found one.

So, I'm working on solution, based on Runtime.getRuntime().exec("something");

I already know what commands i should write in Mac and Windows to open "application selection" for file:
1) Windows: RUNDLL32.EXE SHELL32.DLL,OpenAs_RunDLL <file.ext>
2) Mac: open <file.ext>

How to do same on linux (Gnome/KDE)? I still not found easy solution for that.

Or maybe I am digging in wrong direction? If so - prease correct me.

P.S. I tried Desktop.getDesktop() and Java Desktop Integration Components (JDIC), but it seems, that both of them don't have a function for functionality i need.

Thank you for your replies.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 2 2009
Added on Feb 11 2009
8 comments
341 views