Ubuntu手动安装Eclipse
转自:Ubuntu中文论坛
-----------------------------------------------------------------------
1. 安装Java环境
2. 下载Eclipse安装包:http://www.eclipse.org/downloads/index.php
3. 切换为root用:
zhong@ubuntu:~/Desktop$ sudo -s -H
4. 解压到/opt目录下:
root@ubuntu:/home/zhong/Desktop # tar zxvf eclipse-SDK-3.1-linux-gtk.tar.gz -C /opt
5. 目录设置权限:
root@ubuntu:/home/zhong/Desktop # chown -R root:root /opt/eclipse
6. 创建/usr/bin/eclipse文件
root@ubuntu:/home/zhong/Desktop # cat > /usr/bin/eclipse << "EOF"
> #!/bin/sh
> export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
> export ECLIPSE_HOME="/opt/eclipse"
> $ECLIPSE_HOME/eclipse $*
> # End /usr/bin/eclipse
> EOF
7. 设置/eclipse/bin/eclipse为可执行文件
root@ubuntu:/home/zhong/Desktop # chmod +x /usr/bin/eclipse
8. 增加菜单项
root@ubuntu:/home/zhong/Desktop # cat > /usr/share/applications/eclipse.desktop << "EOF"
> [Desktop Entry]
> Encoding=UTF-8
> Name=Eclipse Platform
> Comment=Eclipse IDE
> Exec=eclipse
> Icon=/opt/eclipse/icon.xpm
> Terminal=false
> Type=Application
> Categories=GNOME;Application;Development;
> StartupNotify=true
> EOF
退出root用户
root@ubuntu:/home/zhong/Desktop # exit
zhong@ubuntu:~/Desktop$
![](http://img.zemanta.com/pixy.gif?x-id=7c22e8d5-235b-86b7-a1ef-384029b8c8b4)