I have a Java program that runs on Linux, and from within the program, I want to open files (e.g. PDF files) with the system's native viewer. There are various programs available for this purpose: gnome-open, gvfs-open, xdg-open, ... Which one(s) should I use to cover as many Linux distributions as possible?

1 Answer 1


xdg-open is the safest bet. Not everyone will necessarily have gnome or gvfs installed. xdg-open, on the other hand, is not tied to any desktop environment or toolkit.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .