Tuesday, November 12, 2013

Install Eclipse on Ubuntu 12.10 64bit

This article describes process about:
- installation of JVM;
- installation of Eclipse IDE;
- tunning the Eclipse IDE for starting  from launch panel.

Installation of JDK.

  1.  Go to Java SE Downloads page and download archive .tar.gz with newest version of JDK - jdk-XuXX-linux-x64.tar.gz.
  2. Go to Eclipse Download page and downdload Eclipse IDE for Java EE Developers for Linux 64 bit.
  3. Suggest that download catalog is ~/Download.
  4. Go to ~/Download

  5. cd /Download

    and unpacking our JDK - jdk-XuXX-linux-x64.tar.gz.

    tar xvfz JDK - jdk-XuXX-linux-x64.tar.gz
    
  6. move the JDK 7 directory to /usr/lib
    sudo mkdir -p /usr/lib/jvm
    sudo mv ./jdk.1.7.0_02 /usr/lib/jvm/jdk1.7.0
  7. Now run
    sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0/bin/java" 1
    sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0/bin/javac" 1
    sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0/bin/javaws" 1
  8. Correct the file ownership and the permissions of the executables:
    sudo chmod a+x /usr/bin/java sudo chmod a+x /usr/bin/javac
    sudo chmod a+x /usr/bin/javaws
    sudo chown -R root:root /usr/lib/jvm/jdk1.7.0
  9. Run
    sudo update-alternatives --config java
  10. If you have a problem with maven like this

    Missing artifact com.sun:tools:jar:1.5.0:system pom.xml

    You can have eclipse start up using your built in JDK by altering the eclipse.ini and adding something like

    -vm
    /usr/java/jdk1.7.0_17/bin/java

    The example of eclipse.ini in Linux:

    -startup
    plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar
    --launcher.library
    plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.1.200.v20120913-144807
    -product
    org.eclipse.epp.package.jee.product
    --launcher.defaultAction
    openFile
    -showsplash
    org.eclipse.platform
    --launcher.XXMaxPermSize
    256m
    --launcher.defaultAction
    openFile
    -vm
    /usr/java/jdk1.7.0_17/bin/java
    -vmargs
    -Dosgi.requiredJavaVersion=1.5
    -Dorg.eclipse.swt.browser.DefaultType=webkit
    -Dhelp.lucene.tokenizer=standard
    -XX:MaxPermSize=256m
    -Xms40m
    -Xmx512m

    From stackoverflow.com
  11. If you have problem like this:

    Unhandled event loop exception No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]

    I founded the solution here askubuntu

    Use Webkit instead of XULRunner
    Install the package  and configured Eclipse  to use Webkit instead of Xulrunner by adding this line to the eclipse.ini:

    -Dorg.eclipse.swt.browser.DefaultType=webkit

    Restart Eclipse.
  12. If you have problem like this:

    Event log:

    Unhandled event loop exception


    org.eclipse.swt.SWTError: No more handles
    at org.eclipse.swt.SWT.error(SWT.java:4445)
    at org.eclipse.swt.SWT.error(SWT.java:4334)
    at org.eclipse.swt.SWT.error(SWT.java:4305)
    at org.eclipse.swt.browser.Browser.<init>(Browser.java:103)

    Just:
    sudo apt-get install libwebkitgtk-1.0-0