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 files using default association

807591Apr 10 2008 — edited Apr 29 2008
Hello,

I'm trying to programmatically open files with their OS default associations. So for windows platform I have:

Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL " + file.getAbsolutePath());

This does not work when file names contain unicode characters like "�s����.jpg". Does anyone have a solution for this? What is the proper and recommended way to open files?

Thanks,
Marcin
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 27 2008
Added on Apr 10 2008
14 comments
723 views