特殊:Badtitle/NS100:EclipseIDE:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第2行: | 第2行: | ||
{{Languages|UbuntuHelp:EclipseIDE}} | {{Languages|UbuntuHelp:EclipseIDE}} | ||
Parent page: [[UbuntuHelp:Programming| Programming Applications]] | Parent page: [[UbuntuHelp:Programming| Programming Applications]] | ||
== Introduction == | == Introduction == | ||
Eclipse is an '''I'''ntegrated '''D'''evelopment '''E'''nvironment 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. | Eclipse is an '''I'''ntegrated '''D'''evelopment '''E'''nvironment 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 == | == Installation == | ||
Install the <code><nowiki>eclipse</nowiki></code> package from the Universe repository. | Install the <code><nowiki>eclipse</nowiki></code> package from the Universe repository. | ||
See InstallingSoftware for detailed instructions on using repositories and package managers. | See InstallingSoftware for detailed instructions on using repositories and package managers. | ||
== Eclipse and Sun Java == | == 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). | 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 <code><nowiki>sun-java6-jre</nowiki></code> from the dapper-backports Multiverse repository. Please take a look at UbuntuBackports for more information on using backport repositories. | '''Note:''' if you're using Ubuntu 6.06 (Dapper) you'll need to install <code><nowiki>sun-java6-jre</nowiki></code> 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. | 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. | * Add the path of the Sun JVM above the GCJ JVM entry. | ||
第31行: | 第17行: | ||
[...] | [...] | ||
</nowiki></pre> | </nowiki></pre> | ||
* To ensure that the change has happened open Eclipse and click on ''Help -> About Eclipse SDK -> Configuration details'' look for this line: | * To ensure that the change has happened open Eclipse and click on ''Help -> About Eclipse SDK -> Configuration details'' look for this line: | ||
<pre><nowiki> | <pre><nowiki> | ||
第39行: | 第24行: | ||
[...] | [...] | ||
</nowiki></pre> | </nowiki></pre> | ||
As an added bonus you may also enjoy a speed up after doing this. | As an added bonus you may also enjoy a speed up after doing this. | ||
=== Sun JVM System Wide === | === Sun JVM System Wide === | ||
You may also want to use the Sun JVM system wide. Enabling the Sun JVM is a snap using '''update-java-alternatives'''. | You may also want to use the Sun JVM system wide. Enabling the Sun JVM is a snap using '''update-java-alternatives'''. | ||
* First find out which versions of java you have installed through Ubuntu. | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo update-java-alternatives --list | sudo update-java-alternatives --list | ||
output: | output: | ||
java-1.5.0-sun 53 /usr/lib/jvm/java-1.5.0-sun | java-1.5.0-sun 53 /usr/lib/jvm/java-1.5.0-sun | ||
java-6-sun 63 /usr/lib/jvm/java-6-sun | java-6-sun 63 /usr/lib/jvm/java-6-sun | ||
</nowiki></pre> | </nowiki></pre> | ||
* Next, specify the one you want to become the default. | |||
<pre><nowiki> | <pre><nowiki> | ||
sudo update-java-alternatives --set java-6-sun | sudo update-java-alternatives --set java-6-sun | ||
</nowiki></pre> | </nowiki></pre> | ||
'''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. | '''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. | ||
=== Using Sun Java as the Default JRE for Eclipse Projects === | === Using Sun Java as the Default JRE for Eclipse Projects === | ||
To use the java-6-sun as the default JRE within Eclipse and to have it used in the build path of Java projects click on ''Window -> Preferences -> Java -> Installed JREs'' and you will see the current JRE's available to Eclipse. To add java-6-sun click the ''Add...'' button. A dialog window will come up with configuration options. First set the JRE home directory by clicking the ''Browse'' button and navigating to <code><nowiki>/usr/lib/jvm/java-6-sun</nowiki></code>. After selecting this location the rest of the fields should be filled out automatically. Hit OK, and back in the Installed JREs area, place a check box next to java-6-sun to set it as the Eclipse default JRE. | To use the java-6-sun as the default JRE within Eclipse and to have it used in the build path of Java projects click on ''Window -> Preferences -> Java -> Installed JREs'' and you will see the current JRE's available to Eclipse. To add java-6-sun click the ''Add...'' button. A dialog window will come up with configuration options. First set the JRE home directory by clicking the ''Browse'' button and navigating to <code><nowiki>/usr/lib/jvm/java-6-sun</nowiki></code>. After selecting this location the rest of the fields should be filled out automatically. Hit OK, and back in the Installed JREs area, place a check box next to java-6-sun to set it as the Eclipse default JRE. | ||
* '''Note:''' This is already set in Ubuntu 7.10 (Gutsy) | * '''Note:''' This is already set in Ubuntu 7.10 (Gutsy) | ||
=== Java3d === | === Java3d === | ||
Java3d is now supported for use with Eclipse on Ubuntu, see Java3dUbuntu. | Java3d is now supported for use with Eclipse on Ubuntu, see Java3dUbuntu. | ||
== Installing Plugins == | == 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, accessed in Eclipse by selecting ''Help -> Software Updates -> Find and Install''. | 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, accessed in Eclipse by selecting ''Help -> Software Updates -> Find and Install''. | ||
=== Plugin Installation Example === | === 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. | 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: | 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. | * 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''. | * Choose ''Search for new features to install -> Next''. | ||
第97行: | 第60行: | ||
* A ''Feature Verification'' dialog will appear click ''Install All''. | * A ''Feature Verification'' dialog will appear click ''Install All''. | ||
* After the plugin installs click ''Yes'' to restart Eclipse. | * 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. | 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. | '''Note:''' Most plugins will have a link to the url that you can paste into the udpate manager. | ||
=== Other Plugin Guides === | === Other Plugin Guides === | ||
* See [[UbuntuHelp:PHPEclipse]] for detailed instructions on installing and using that plugin. | * See [[UbuntuHelp:PHPEclipse]] for detailed instructions on installing and using that plugin. | ||
=== Plugin Troubleshooting === | === 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: | 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: | ||
<pre><nowiki> | <pre><nowiki> | ||
eclipse -vm $JAVA_HOME/bin/java -ws gtk | eclipse -vm $JAVA_HOME/bin/java -ws gtk | ||
</nowiki></pre> | </nowiki></pre> | ||
== User installation == | == User installation == | ||
Use this method if you want Eclipse available only for yourself, or if you do not have root access to the computer. | Use this method if you want Eclipse available only for yourself, or if you do not have root access to the computer. | ||
=== Eclipse === | === Eclipse === | ||
* Make an opt folder in your home directory: | * Make an opt folder in your home directory: | ||
<pre><nowiki> | <pre><nowiki> | ||
第139行: | 第89行: | ||
export MOZILLA_FIVE_HOME="/usr/lib/mozilla/" | export MOZILLA_FIVE_HOME="/usr/lib/mozilla/" | ||
export ECLIPSE_HOME="$HOME/opt/eclipse" | export ECLIPSE_HOME="$HOME/opt/eclipse" | ||
$ECLIPSE_HOME/eclipse $* | $ECLIPSE_HOME/eclipse $* | ||
</nowiki></pre> | </nowiki></pre> | ||
第146行: | 第95行: | ||
$ chmod +x ~/bin/eclipse | $ chmod +x ~/bin/eclipse | ||
</nowiki></pre> | </nowiki></pre> | ||
=== Gnome icon === | === 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) | * 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: <code><nowiki>Eclipse Platform</nowiki></code> | ** Name: <code><nowiki>Eclipse Platform</nowiki></code> | ||
** Command: <code><nowiki>/home/<your username>/bin/eclipse</nowiki></code> | ** Command: <code><nowiki>/home/<your username>/bin/eclipse</nowiki></code> | ||
** Icon: <code><nowiki>/home/<your username>/opt/eclipse/icon.xpm</nowiki></code> | ** Icon: <code><nowiki>/home/<your username>/opt/eclipse/icon.xpm</nowiki></code> | ||
== General Troubleshooting == | == General Troubleshooting == | ||
Below are some reported errors and the appropriate fixes | Below are some reported errors and the appropriate fixes | ||
=== No Java Virtual Machine found === | === No Java Virtual Machine found === | ||
If installing Eclipse seems to work, but trying to run it results only in the following error message: | If installing Eclipse seems to work, but trying to run it results only in the following error message: | ||
<pre><nowiki> | <pre><nowiki> | ||
A Java Runtime Environment (JRE) or Java Development Kit (JDK) | A Java Runtime Environment (JRE) or Java Development Kit (JDK) | ||
第167行: | 第110行: | ||
/usr/lib/j2sdk1.4-sun/bin/java | /usr/lib/j2sdk1.4-sun/bin/java | ||
</nowiki></pre> | </nowiki></pre> | ||
You either have no Java Virtual Machine installed or Eclipse cannot find it. Above on this page it shows that you can check what versions of java are installed by running the following command: | You either have no Java Virtual Machine installed or Eclipse cannot find it. Above on this page it shows that you can check what versions of java are installed by running the following command: | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo update-java-alternatives --list | sudo update-java-alternatives --list | ||
</nowiki></pre> | </nowiki></pre> | ||
If the output of that is just awk errors about missing /usr/lib/jvm/*.jinfo files, it appears there are no Java Virtual Machines installed, and you could install one (and generally fix this error) by running: | If the output of that is just awk errors about missing /usr/lib/jvm/*.jinfo files, it appears there are no Java Virtual Machines installed, and you could install one (and generally fix this error) by running: | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo apt-get install sun-java6-jdk | sudo apt-get install sun-java6-jdk | ||
</nowiki></pre> | </nowiki></pre> | ||
During the installation you must agree to the Sun license. Check and see if Eclipse launches normally now. | During the installation you must agree to the Sun license. Check and see if Eclipse launches normally now. | ||
If it still reports the same error as above after installation of a JVM and running your "... --list" command above now results in output like: | If it still reports the same error as above after installation of a JVM and running your "... --list" command above now results in output like: | ||
java-6-sun 63 /usr/lib/jvm/java-6-sun | java-6-sun 63 /usr/lib/jvm/java-6-sun | ||
Make sure that the detected directory (the /usr/lib/jvm/java-6-sun part) appears as the first line without a "#" in front of it in: | Make sure that the detected directory (the /usr/lib/jvm/java-6-sun part) appears as the first line without a "#" in front of it in: | ||
<pre><nowiki> | <pre><nowiki> | ||
sudo gedit /etc/eclipse/java_home | sudo gedit /etc/eclipse/java_home | ||
</nowiki></pre> | </nowiki></pre> | ||
This should allow Eclipse to find your JVM. | This should allow Eclipse to find your JVM. | ||
=== The Eclipse executable launcher was unable to locate its companion startup.jar === | === The Eclipse executable launcher was unable to locate its companion startup.jar === | ||
If the following error is encountered when running eclipse from the launcher: | If the following error is encountered when running eclipse from the launcher: | ||
<pre><nowiki> | <pre><nowiki> | ||
The Eclipse executable launcher was unable to locate its companion startup.jar file (in the same directory as the executable) | The Eclipse executable launcher was unable to locate its companion startup.jar file (in the same directory as the executable) | ||
</nowiki></pre> | </nowiki></pre> | ||
Edit <code><nowiki>/usr/bin/eclipse</nowiki></code> with a text editor (e.g <code><nowiki>sudo gedit /usr/bin/eclipse</nowiki></code>) and change the content to the following: | Edit <code><nowiki>/usr/bin/eclipse</nowiki></code> with a text editor (e.g <code><nowiki>sudo gedit /usr/bin/eclipse</nowiki></code>) and change the content to the following: | ||
<pre><nowiki> | <pre><nowiki> | ||
#!/bin/sh | #!/bin/sh | ||
# Eclipse startup script | # Eclipse startup script | ||
# JPackage Project <http://www.jpackage.org/> | # JPackage Project <http://www.jpackage.org/> | ||
# $Id$ | # $Id$ | ||
ECLIPSE_OPTS="" | ECLIPSE_OPTS="" | ||
VM_OPTS="" | VM_OPTS="" | ||
# Source system prefs | # Source system prefs | ||
if [ -r /etc/eclipse.conf ] ; then | if [ -r /etc/eclipse.conf ] ; then | ||
# /etc/eclipse.conf | |||
fi | fi | ||
# Source user prefs | # Source user prefs | ||
if [ -r $HOME/.eclipserc ] ; then | if [ -r $HOME/.eclipserc ] ; then | ||
# $HOME/.eclipserc | |||
fi | fi | ||
# Set data dir if -data wasn't given. | # Set data dir if -data wasn't given. | ||
if ! echo $@ | grep '\-data ' >/dev/null 2>&1 && [ -n "$USER_DIR" ]; then | if ! echo $@ | grep '\-data ' >/dev/null 2>&1 && [ -n "$USER_DIR" ]; then | ||
ECLIPSE_OPTS="$ECLIPSE_OPTS -data $USER_DIR" | ECLIPSE_OPTS="$ECLIPSE_OPTS -data $USER_DIR" | ||
fi | fi | ||
# Find our JVM. | # Find our JVM. | ||
# if [ ! -x "$JAVACMD" -a -r /usr/share/java-utils/java-functions ]; then | # if [ ! -x "$JAVACMD" -a -r /usr/share/java-utils/java-functions ]; then | ||
第233行: | 第156行: | ||
# set_javacmd | # set_javacmd | ||
# fi | # fi | ||
JAVACMD="/usr/lib/j2re1.5-sun/bin/java" | JAVACMD="/usr/lib/j2re1.5-sun/bin/java" | ||
# Set JVM if -vm wasn't given. | # Set JVM if -vm wasn't given. | ||
if ! echo $@ | grep '\-vm ' >/dev/null 2>&1 && [ -n "$JAVACMD" ]; then | if ! echo $@ | grep '\-vm ' >/dev/null 2>&1 && [ -n "$JAVACMD" ]; then | ||
ECLIPSE_OPTS="$ECLIPSE_OPTS -vm $JAVACMD" | ECLIPSE_OPTS="$ECLIPSE_OPTS -vm $JAVACMD" | ||
fi | fi | ||
# Set JVM args if -vmargs wasn't given. This needs to be the last option. | # 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 | if ! echo $@ | grep '\-vmargs ' >/dev/null 2>&1 && [ -n "$VM_ARGS" ]; then | ||
VM_OPTS="-vmargs $VM_ARGS" | VM_OPTS="-vmargs $VM_ARGS" | ||
fi | fi | ||
# if [ -w $USER_DIR/.metadata/.config/platform.cfg ]; then | # 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 | # perl -p -i.bak -e 's|^site\.[0-9]*\.list\.[0-9]*=.*\n||g;' $USER_DIR/.metadata/.config/platform.cfg | ||
# fi | # fi | ||
/opt/eclipse/eclipse $ECLIPSE_OPTS $@ $VM_OPTS | /opt/eclipse/eclipse $ECLIPSE_OPTS $@ $VM_OPTS | ||
</nowiki></pre> | </nowiki></pre> | ||
*'''Source:''' http://www.karakas-online.de/forum/viewtopic.php?t=2565 | *'''Source:''' http://www.karakas-online.de/forum/viewtopic.php?t=2565 | ||
== Notes == | == Notes == | ||
*This guide has been tested using Ubuntu 6.06 (Dapper), Ubuntu 7.04 (Feisty), Ubuntu 7.10 (Gutsy). | *This guide has been tested using Ubuntu 6.06 (Dapper), Ubuntu 7.04 (Feisty), Ubuntu 7.10 (Gutsy). | ||
* 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 | |||
---- | ---- | ||
[[category:CategoryDocumentation]] [[category:CategoryCleanup]] | [[category:CategoryDocumentation]] [[category:CategoryCleanup]] | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2007年11月30日 (五) 16:56的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/EclipseIDE }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/af | • {{#if: UbuntuHelp:EclipseIDE|Afrikaans| [[::EclipseIDE/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/ar | • {{#if: UbuntuHelp:EclipseIDE|العربية| [[::EclipseIDE/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/az | • {{#if: UbuntuHelp:EclipseIDE|azərbaycanca| [[::EclipseIDE/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/bcc | • {{#if: UbuntuHelp:EclipseIDE|جهلسری بلوچی| [[::EclipseIDE/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/bg | • {{#if: UbuntuHelp:EclipseIDE|български| [[::EclipseIDE/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/br | • {{#if: UbuntuHelp:EclipseIDE|brezhoneg| [[::EclipseIDE/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/ca | • {{#if: UbuntuHelp:EclipseIDE|català| [[::EclipseIDE/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/cs | • {{#if: UbuntuHelp:EclipseIDE|čeština| [[::EclipseIDE/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/de | • {{#if: UbuntuHelp:EclipseIDE|Deutsch| [[::EclipseIDE/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/el | • {{#if: UbuntuHelp:EclipseIDE|Ελληνικά| [[::EclipseIDE/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/es | • {{#if: UbuntuHelp:EclipseIDE|español| [[::EclipseIDE/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/fa | • {{#if: UbuntuHelp:EclipseIDE|فارسی| [[::EclipseIDE/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/fi | • {{#if: UbuntuHelp:EclipseIDE|suomi| [[::EclipseIDE/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/fr | • {{#if: UbuntuHelp:EclipseIDE|français| [[::EclipseIDE/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/gu | • {{#if: UbuntuHelp:EclipseIDE|ગુજરાતી| [[::EclipseIDE/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/he | • {{#if: UbuntuHelp:EclipseIDE|עברית| [[::EclipseIDE/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/hu | • {{#if: UbuntuHelp:EclipseIDE|magyar| [[::EclipseIDE/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/id | • {{#if: UbuntuHelp:EclipseIDE|Bahasa Indonesia| [[::EclipseIDE/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/it | • {{#if: UbuntuHelp:EclipseIDE|italiano| [[::EclipseIDE/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/ja | • {{#if: UbuntuHelp:EclipseIDE|日本語| [[::EclipseIDE/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/ko | • {{#if: UbuntuHelp:EclipseIDE|한국어| [[::EclipseIDE/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/ksh | • {{#if: UbuntuHelp:EclipseIDE|Ripoarisch| [[::EclipseIDE/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/mr | • {{#if: UbuntuHelp:EclipseIDE|मराठी| [[::EclipseIDE/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/ms | • {{#if: UbuntuHelp:EclipseIDE|Bahasa Melayu| [[::EclipseIDE/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/nl | • {{#if: UbuntuHelp:EclipseIDE|Nederlands| [[::EclipseIDE/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/no | • {{#if: UbuntuHelp:EclipseIDE|norsk| [[::EclipseIDE/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/oc | • {{#if: UbuntuHelp:EclipseIDE|occitan| [[::EclipseIDE/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/pl | • {{#if: UbuntuHelp:EclipseIDE|polski| [[::EclipseIDE/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/pt | • {{#if: UbuntuHelp:EclipseIDE|português| [[::EclipseIDE/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/ro | • {{#if: UbuntuHelp:EclipseIDE|română| [[::EclipseIDE/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/ru | • {{#if: UbuntuHelp:EclipseIDE|русский| [[::EclipseIDE/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/si | • {{#if: UbuntuHelp:EclipseIDE|සිංහල| [[::EclipseIDE/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/sq | • {{#if: UbuntuHelp:EclipseIDE|shqip| [[::EclipseIDE/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/sr | • {{#if: UbuntuHelp:EclipseIDE|српски / srpski| [[::EclipseIDE/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/sv | • {{#if: UbuntuHelp:EclipseIDE|svenska| [[::EclipseIDE/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/th | • {{#if: UbuntuHelp:EclipseIDE|ไทย| [[::EclipseIDE/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/tr | • {{#if: UbuntuHelp:EclipseIDE|Türkçe| [[::EclipseIDE/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/vi | • {{#if: UbuntuHelp:EclipseIDE|Tiếng Việt| [[::EclipseIDE/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/yue | • {{#if: UbuntuHelp:EclipseIDE|粵語| [[::EclipseIDE/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/zh | • {{#if: UbuntuHelp:EclipseIDE|中文| [[::EclipseIDE/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/zh-hans | • {{#if: UbuntuHelp:EclipseIDE|中文(简体)| [[::EclipseIDE/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:EclipseIDE | UbuntuHelp:EclipseIDE | {{#if: | :}}EclipseIDE}}/zh-hant | • {{#if: UbuntuHelp:EclipseIDE|中文(繁體)| [[::EclipseIDE/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:EclipseIDE|:EclipseIDE|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :EclipseIDE/zh | | {{#ifexist: EclipseIDE/zh | | {{#ifeq: {{#titleparts:EclipseIDE|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:EclipseIDE|1|-1|}} | zh | | }}
Parent page: Programming Applications
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-java-alternatives.
- First find out which versions of java you have installed through Ubuntu.
sudo update-java-alternatives --list output: java-1.5.0-sun 53 /usr/lib/jvm/java-1.5.0-sun java-6-sun 63 /usr/lib/jvm/java-6-sun
- Next, specify the one you want to become the default.
sudo update-java-alternatives --set java-6-sun
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.
Using Sun Java as the Default JRE for Eclipse Projects
To use the java-6-sun as the default JRE within Eclipse and to have it used in the build path of Java projects click on Window -> Preferences -> Java -> Installed JREs and you will see the current JRE's available to Eclipse. To add java-6-sun click the Add... button. A dialog window will come up with configuration options. First set the JRE home directory by clicking the Browse button and navigating to /usr/lib/jvm/java-6-sun
. After selecting this location the rest of the fields should be filled out automatically. Hit OK, and back in the Installed JREs area, place a check box next to java-6-sun to set it as the Eclipse default JRE.
- Note: This is already set in Ubuntu 7.10 (Gutsy)
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 Eclipse Plugin Central for details on individual plugins. One of the simplest ways to install Eclipse Plugins is through the Update Manager, accessed in Eclipse by selecting Help -> Software Updates -> Find and Install.
Plugin Installation Example
In this example we'll install the RDT (Ruby Development Tools) plugin. This plugin will give Eclipse support for the 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.
Other Plugin Guides
- See UbuntuHelp:PHPEclipse for detailed instructions on installing and using that plugin.
Plugin Troubleshooting
Some plugins do not seem to function properly when running Eclipse normally, such as 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 do not have 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.gvi ~/bin/eclipse
) and add the following content:
#!/bin/sh 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
- Name:
General Troubleshooting
Below are some reported errors and the appropriate fixes
No Java Virtual Machine found
If installing Eclipse seems to work, but trying to run it results only in the following error message:
A Java Runtime Environment (JRE) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following locations: /usr/lib/j2sdk1.4-sun/bin/java
You either have no Java Virtual Machine installed or Eclipse cannot find it. Above on this page it shows that you can check what versions of java are installed by running the following command:
sudo update-java-alternatives --list
If the output of that is just awk errors about missing /usr/lib/jvm/*.jinfo files, it appears there are no Java Virtual Machines installed, and you could install one (and generally fix this error) by running:
sudo apt-get install sun-java6-jdk
During the installation you must agree to the Sun license. Check and see if Eclipse launches normally now. If it still reports the same error as above after installation of a JVM and running your "... --list" command above now results in output like: java-6-sun 63 /usr/lib/jvm/java-6-sun Make sure that the detected directory (the /usr/lib/jvm/java-6-sun part) appears as the first line without a "#" in front of it in:
sudo gedit /etc/eclipse/java_home
This should allow Eclipse to find your JVM.
The Eclipse executable launcher was unable to locate its companion startup.jar
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:
#!/bin/sh # 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
Notes
- This guide has been tested using Ubuntu 6.06 (Dapper), Ubuntu 7.04 (Feisty), Ubuntu 7.10 (Gutsy).
- 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