简体   繁体   English

在Linux中使用Java打开EML文件

[英]Open an eml file with java in linux

I am trying to open my created .eml file with java in linux. 我正在尝试在Linux中使用Java打开我创建的.eml文件。 Currently I am using the following command: 当前,我正在使用以下命令:

Desktop.getDesktop().open(emlFile);

I create the eml file as shown in this example. 例所示,我创建了eml文件。 This works for my windows system, but an error occurs in linux ubuntu 12.04. 这适用于我的Windows系统,但是在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) 从文档java.awt.Desktop.open(File)

Throws IOException - if the specified file has no associated application or the associated application fails to be launched 引发IOException-如果指定的文件没有关联的应用程序,或者关联的应用程序无法启动

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM