0

I am trying to open my created .eml file with java in linux. Currently I am using the following command:

Desktop.getDesktop().open(emlFile);

I create the eml file as shown in this example. This works for my windows system, but an error occurs in linux ubuntu 12.04.

EDIT: error message:

(process:19386): gnome-vfs-modules-WARNING **: Could not initialize inotify

java.io.IOException: Failed to show URI:file:/home/usr/workspace/programm/eml/mail.eml
at sun.awt.X11.XDesktopPeer.launch(Unknown Source)
at sun.awt.X11.XDesktopPeer.open(Unknown Source)
at java.awt.Desktop.open(Unknown Source)

I am happy for any help!

Community
  • 1
  • 1
Steckdoserich
  • 834
  • 2
  • 11
  • 24

1 Answers1

2

From the docs java.awt.Desktop.open(File)

Throws IOException - if the specified file has no associated application or the associated application fails to be launched

ignis
  • 8,692
  • 2
  • 23
  • 20
  • Thanks for your advice @ignis . As it seems linux didnt know how to open a .eml file. After I opened it with gedit and thunderbird, the error disapears. At the moment my java application opens the eml file with gedit and over my folder system it's opened with thunderbird. – Steckdoserich Jan 23 '13 at 19:18
  • This error still appears: (process:19950): gnome-vfs-modules-WARNING **: Could not initialize inotify – Steckdoserich Jan 23 '13 at 19:19
  • That's a warning, not an error. You should be able to open the file nevertheless. – ignis Jan 23 '13 at 19:22
  • Yes you are right @ignis, but it would be better if the java application would open that file with an e-mail client and not with the gedit. – Steckdoserich Jan 23 '13 at 19:43