6

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?

Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
python dude
  • 163
  • 4

1 Answers1

8

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.

TheBlackCat
  • 286
  • 2
  • 8