今天在Centos上安装了下Eclipse,但是安装完了之后,发现只能从Eclipse的bin目录中去执行eclipse脚本来启动Eclipse。
后再在网上了找个创建桌面快捷方式的办法,记录如下:
通过命令行,进入到桌面文件夹中
cd /home/your_username/desktop
新建一个以“.desktop”结尾的文件
vim eclipse.desktop
将以下内容写至该文件中
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Encoding=UTF-8
Name=eclipse
Type=Application
Terminal=false
Name[en_US]=eclipse
Exec=**/opt/eclipse/mars/eclipse**
Comment[en_US]=Eclipse Mars.2
Comment=Eclipse Mars.2
GenericName[en_US]=
Icon=/opt/eclipse/mars/eclipse.png
注意“Exec”填写成 Eclipse 的脚本文件的路径即可。