Parent page: [:Programming: Programming Applications]
ContentsBRTableOfContents |
Introduction
Eclipse is an Integrated Development Environment or IDE. The Eclipse was originally created by IBM, but the Eclipse Foundation has since taken over direction and development of the project. Eclipse started out as a Java IDE, but has since grown into much more.
Installation
Install the eclipse package from the Universe repository.
See InstallingSoftware for detailed instructions on using repositories and package managers.
Eclipse and Sun Java
By default, the eclipse which is packaged with Ubuntu runs with the GCJ JVM and not the JVM supplied by Sun Microsystems even if you have installed the Sun version (from the Multiverse repository).
Note: if you're using Ubuntu 6.06 (Dapper) you'll need to install sun-java6-jre from the dapper-backports Multiverse repository. Please take a look at UbuntuBackports for more information on using backport repositories.
In order to load eclipse with the Sun JVM, edit the /etc/eclipse/java_home file.
- Add the path of the Sun JVM above the GCJ JVM entry.
/usr/lib/jvm/java-6-sun /usr/lib/jvm/java-gcj [...]
To ensure that the change has happened open Eclipse and click on Help -> About Eclipse SDK -> Configuration details look for this line:
[...] -vm /usr/lib/jvm/java-6-sun/bin/java [...]
As an added bonus you may also enjoy a speed up after doing this.
Sun JVM System Wide
You may also want to use the Sun JVM system wide.
Enabling the Sun JVM is a snap using update-alternatives:
sudo update-alternatives --config java output: There are 3 alternatives which provide `java'. Selection Alternative ----------------------------------------------- 1 /usr/bin/gij-wrapper-4.1 *+ 2 /usr/lib/jvm/java-gcj/jre/bin/java 3 /usr/lib/jvm/java-6-sun/jre/bin/java Press enter to keep the default[*], or type selection number: 3
Note: The JVMs listed may differ depending on the version of Ubuntu you're using and the setup of your system. The important thing is to choose the JVM with sun in the title.
Java3d
Java3d is now supported for use with Eclipse on Ubuntu, see Java3dUbuntu.
Installing Plugins
One of the great features of Eclipse is the wide variety of plugins available for the platform. See [http://www.eclipseplugincentral.com/ Eclipse Plugin Central] for details on individual plugins.
One of the simplest ways to install Eclipse Plugins is through the Update Manager.
See ["PHPEclipse"] for detailed instructions on installing and using that plugin.
Plugin Installation Example
In this example we'll install the [http://rubyeclipse.sourceforge.net/ RDT (Ruby Development Tools)] plugin. This plugin will give Eclipse support for the [http://www.ruby-lang.org/ Ruby] programming language.
To install RDT:
Open Eclipse and click on Help -> Software Updates -> Find and Install. This will bring up a dialog allowing you to choose from updates to currently installed features or finding new features to install.
Choose Search for new features to install -> Next.
Click the New Remote Site button. A dialog opens allowing you to input the location of the plugin you wish to install.
In the Name: box place RDT (or Ruby if that's more descriptive).
In URL: type http://updatesite.rubypeople.org/release. Then click Ok.
You should now see RDT in the list of Sites to include in search: box.
Click on Finish
A dialog to install RDT should now appear. Click the checkbox next to RDT in the Select features to install: area.
Click Next -> Accept the License Agreement -> Next -> Finish
A Feature Verification dialog will appear click Install All.
After the plugin installs click Yes to restart Eclipse.
That's all there is to it you can now create Ruby projects and enjoy all the features of the Eclipse IDE.
Note: Most plugins will have a link to the url that you can paste into the udpate manager.
Plugin Troubleshooting
Some plugins do not seem to function properly when running Eclipse normally, such as [http://www.eclipse.org/birt BIRT]. Running Eclipse with the following options may fix the plugin:
eclipse -vm $JAVA_HOME/bin/java -ws gtk
User installation
Use this method if you want Eclipse available only for yourself, or if you haven't got root access to the computer.
Eclipse
- Make an opt folder in your home directory:
$ mkdir ~/opt
- Unzip eclipse in the opt folder:
$ unzip eclipse-platform-3.1.2-linux-gtk.zip -d ~/opt
- Make a bin folder in your home directory, this will be used for the startup script:
$ mkdir ~/bin
Create ~/bin/eclipse with your favorite text editor (e.g vi ~/bin/eclipse) and add the following content:
export MOZILLA_FIVE_HOME="/usr/lib/mozilla/" export ECLIPSE_HOME="$HOME/opt/eclipse" $ECLIPSE_HOME/eclipse $*
- Finally, allow the script to be executed:
$ chmod +x ~/bin/eclipse
Gnome icon
Create a new launcher on the desktop (right click on the desktop -> Create Launcher) or on a panel (right click on a panel -> Add to Panel -> Custom Application Launcher)
Name: Eclipse Platform
Command: /home/<your username>/bin/eclipse
Icon: /home/<your username>/opt/eclipse/icon.xpm
Troubleshooting
If the following error is encountered when running eclipse from the launcher:
The Eclipse executable launcher was unable to locate its companion startup.jar file (in the same directory as the executable)
Edit /usr/bin/eclipse with a text editor (e.g sudo gedit /usr/bin/eclipse) and change the content to the following:
# Eclipse startup script # JPackage Project <http://www.jpackage.org/> # $Id$ ECLIPSE_OPTS="" VM_OPTS="" # Source system prefs if [ -r /etc/eclipse.conf ] ; then . /etc/eclipse.conf fi # Source user prefs if [ -r $HOME/.eclipserc ] ; then . $HOME/.eclipserc fi # Set data dir if -data wasn't given. if ! echo $@ | grep '\-data ' >/dev/null 2>&1 && [ -n "$USER_DIR" ]; then ECLIPSE_OPTS="$ECLIPSE_OPTS -data $USER_DIR" fi # Find our JVM. # if [ ! -x "$JAVACMD" -a -r /usr/share/java-utils/java-functions ]; then # . /usr/share/java-utils/java-functions # set_javacmd # fi JAVACMD="/usr/lib/j2re1.5-sun/bin/java" # Set JVM if -vm wasn't given. if ! echo $@ | grep '\-vm ' >/dev/null 2>&1 && [ -n "$JAVACMD" ]; then ECLIPSE_OPTS="$ECLIPSE_OPTS -vm $JAVACMD" fi # Set JVM args if -vmargs wasn't given. This needs to be the last option. if ! echo $@ | grep '\-vmargs ' >/dev/null 2>&1 && [ -n "$VM_ARGS" ]; then VM_OPTS="-vmargs $VM_ARGS" fi # if [ -w $USER_DIR/.metadata/.config/platform.cfg ]; then # perl -p -i.bak -e 's|^site\.[0-9]*\.list\.[0-9]*=.*\n||g;' $USER_DIR/.metadata/.config/platform.cfg # fi /opt/eclipse/eclipse $ECLIPSE_OPTS $@ $VM_OPTS
* Source: http://www.karakas-online.de/forum/viewtopic.php?t=2565
Note: This guide has been tested using Ubuntu 6.06 (Dapper), and Ubuntu 7.04 (Feisty).
Except for section 5 User Installation.
- Not sure if that section is really needed???
- Yes, it is needed for eclipse 3.3 for Ubuntu 7.04 (Feisty) and earlier