Tuesday, September 14, 2010

在Ubuntu上安裝eclipse

首先要先確定自己的環境,因為Ubuntu上預設安裝的是OpenJava,
所以要先安裝SUN JAVA並將其配置好。
至於安裝的部份可以參考我上一篇
Ubuntu上安裝SUN-JAVA6 + Apache Tomcat

配置Sun版本的Java,選擇現在要使用的版本。
$ sudo update-alternatives --config java

安裝eclipse,將其安裝在你想要的地方,我同常是放在/usr/local底下
$ sudo tar xzf eclipse-java-helios-linux-gtk.tar.gz
$ sudo chmod -R +r eclipse

建立一個eclipse執行文件
$ sudo touch /usr/bin/eclipse
$ sudo chmod 755 /usr/bin/eclipse
$ sudo gedit /usr/bin/eclipse

#!/bin/sh
export ECLIPSE_HOME="/usr/local/eclipse"

$ECLIPSE_HOME/eclipse $*


建立應用程式選單
$ sudo gedit /usr/share/applications/eclipse.desktop

[Desktop Entry]
Encoding=UTF-8
Name=Eclipse
Comment=Eclipse IDE
Exec=/usr/local/eclipse/eclipse
Icon=/usr/local/eclipse/icon.xpm
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true


在第一次使用eclipse時,先執行以下指令
/usr/local/eclipse/eclipse -clean

現在你可以透過應用程式MENU來開啟eclipse了。

參考資料:
http://flurdy.com/docs/eclipse/install.html

No comments:

Post a Comment