Difference between revisions of "Eclipse"

From ArchWiki
Jump to: navigation, search
m (With C/C++ support)
m (A recent update in eclipse make it segfault when autocompleting or showing some javadoc. -- This is my first contribution to a large wiki.)
Line 94: Line 94:
 
# Enter the path to the previous downloaded "jdk-6-doc.zip" (e.g. /home/docs/jdk-6-doc.zip) in the "Archive path:" text field.
 
# Enter the path to the previous downloaded "jdk-6-doc.zip" (e.g. /home/docs/jdk-6-doc.zip) in the "Archive path:" text field.
 
# Done!
 
# Done!
 +
 +
 +
== Troubleshooting ==
 +
 +
=== Autocompletion and javadoc render crash ===
 +
For some reasons, libxul may crash. To fix this issue, you can install libwebkit and try to add the following lines in your  /usr/share/eclipse/eclipse.ini :
 +
 +
-Dorg.eclipse.swt.browser.UseWebKitGTK=true
 +
 +
If it's not working (or if you don't want to install libwebkit) :
 +
 +
-Dorg.eclipse.swt.browser.XULRunnerPath==/usr/lib/xulrunner-2.0/

Revision as of 23:17, 12 May 2011


Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n links end


Introduction

Eclipse is an open source community project, which aims to provide a universal development platform. The Eclipse project is most widely known for its cross-platform integrated development environment (IDE), and the arch linux packages (and this guide) relate specifically to this.

The Eclipse IDE is largely written in Java but can be used to develop applications in a number of languages, including Java, C/C++, PHP and Perl. The IDE can also provide subversion support (see below) and task management (either through its built-in TODO list or through the eclipse-mylyn package).

Installing Eclipse

It is very easy to install the Eclipse SDK in Arch Linux:

# pacman -S eclipse

This base package has Java development support built in.

With C/C++ support

If you want to use Eclipse for C/C++ development, also install the eclipse cdt

# pacman -S eclipse-cdt

With perl support

If you want to use Eclipse for Perl development, also install EPIC available from AUR:

# pacman -S eclipse-epic

With PHP support

If you want to use Eclipse for PHP development, also install phpeclipse:

# pacman -S eclipse-phpeclipse

Using the Sun JDK in place of OpenJDK

Eclipse depends on openjdk6 by default, which you can easily replaced by jdk.

# pacman -S jdk

By the way, you may want to link the file /opt/java/bin/java to /usr/bin/java:

# ln -s /opt/java/bin/java /usr/bin

Setting up Eclipse

After installing eclipse via pacman, you might want to do some configuration.

enable updates

Your eclipse doesn't have any update sites, yet. On the eclipse site you find several uris, which you can add here as update site Window -> Preferences -> Install/Update -> Available Software Sites -> Add... For me this uri worked wonderful:

http://download.eclipse.org/releases/maintenance

But (if you're using Eclipse 3.6.x, codename Helios) you should use:

http://download.eclipse.org/releases/helios

and automatically added several locations which you can enable in the Available Software Sites menu. After that you can update and install new Software in "Help" menu

Subversion support

There are packages in AUR for enabling Subversion support.

eclipse-subclipse

http://aur.archlinux.org/packages.php?do_Details=1&ID=5280

# pacman -S eclipse-subclipse

Take a look at http://www-128.ibm.com/developerworks/opensource/library/os-ecl-subversion/ for more information about Subclipse.

eclipse-subversive

http://aur.archlinux.org/packages.php?do_Details=1&ID=10740

# aurbuild -s eclipse-subversive

Enable javadoc integration

Want to see API entries when hovering the mouse pointer over standard Java methods?

Online Version

If you have constant internet access on your machine, you can use the online documentation provided by sun. Just follow these instructions:

  1. Go to Window/Preferences, then go to Java/Installed JREs.
  2. There should be one named "java" with the type "Standard VM". Select this and click Edit.
  3. Select the /opt/java/jre/lib/rt.jar item under "JRE system libraries:", then click "Javadoc Location...".
  4. Enter "http://java.sun.com/javase/6/docs/api/" in the "Javadoc location path:" text field.
  5. Done!

Offline Version

If you have no internet connection on your development machine, or do not want to constantly loose traffic for the documentation, you can store the documentation on your local harddisk.

  1. Start your favorite webbrowser and navigate to http://java.sun.com/javase/downloads/index.jsp
  2. Search for "Java SE 6 Documentation" and click the Downloadlink.
  3. Follow the instructions to download the file "jdk-6-doc.zip" to your Harddrive (e.g. /home/docs/jdk-6-doc.zip).
  4. Go to Window/Preferences, then go to Java/Installed JREs.
  5. There should be one named "java" with the type "Standard VM". Select this and click Edit.
  6. Select the /opt/java/jre/lib/rt.jar item under "JRE system libraries:", then click "Javadoc Location...".
  7. Select the point "Javadoc in archive"
  8. Enter the path to the previous downloaded "jdk-6-doc.zip" (e.g. /home/docs/jdk-6-doc.zip) in the "Archive path:" text field.
  9. Done!


Troubleshooting

Autocompletion and javadoc render crash

For some reasons, libxul may crash. To fix this issue, you can install libwebkit and try to add the following lines in your /usr/share/eclipse/eclipse.ini :

-Dorg.eclipse.swt.browser.UseWebKitGTK=true

If it's not working (or if you don't want to install libwebkit) :

-Dorg.eclipse.swt.browser.XULRunnerPath==/usr/lib/xulrunner-2.0/