سؤال

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!

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top