linux(ubuntu)下创建eclipse快捷方式

来源:互联网 发布:淘宝球鞋店 编辑:程序博客网 时间:2024/06/05 00:38

1、 sudo gedit  /usr/share/applications/eclipse.desktop (此步骤生成eclipse.desktop文件,并打开文件,比vi好用)

2、向eclipse .desktop中添加以下内容: 
     [Desktop Entry] 
     Encoding=UTF-8 
     Name=eclipse  
     Comment=Eclipse IDE  
     Exec=/home/hff/SoftwareInstall/eclipse/eclipse  
     Icon=/home/hff/SoftwareInstall/eclipse/icon.xpm  
     Terminal=false  
     StartupNotify=true  
     Type=Application  
     Categories=Application;Development;  

其中Exec和Icon替换成自己eclipse解压目录下相应文件。

3.保存并退出(如果前面不是以管理员[sudo]登录的这里不能保存!!!)


如果打开生成的文件提示“未信任的应用程序启动器”,需要进一步操作。

4.通过快捷键Ctrl + Alt + T打开终端命令操作窗口,输入:sudo nautilus,然后根据提示输入密码,输入完毕可能会出现些警告信息,不用管。警告信息如下:

(nautilus:9906): Gtk-WARNING **: Failed to register client: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.gnome.SessionManager was not provided by any .service files** (nautilus:9906): CRITICAL **: Another desktop manager in use; desktop window won't be created(nautilus:9906): IBUS-WARNING **: The owner of /home/wuqizhisha/.config/ibus/bus is not root!Nautilus-Share-Message: Called "net usershare info" but it failed: 执行子进程“net”失败(没有那个文件或目录)Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

nautilus这个命令是用于以root权限打开文件管理窗口。因为直接操作文件会有权限问题。

5.在文件eclipse.desktop上点击右键,选择属性,在属性窗口中点击权限选项卡,选择所有者为root,勾选允许作为程序执行文件,点击关闭.然后就ok了