Ubuntu – Desktop link to Eclipse

eclipsejava

I was tring to install eclipse on ubuntu. What I did: I unzipped the tar archive of eclipse. I tried to start eclipse from the command line – like this – ./eclipse. It works. But then I tried to create a desktop icon with: gnome-desktop-item-edit ~/Desktop --create-new. In a new icon I showed the path to the eclipse executable which I could launch from the command line. But then eclipse does not start stating:

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:
/home/artem/eclipse/jre/bin/java
java in your current PATH

The same message appears if I try to launch eclipse by double-clicking its original launcher. So it starts from the terminal but not from the desktop (it does not start when double-clicked)
And also I get a message in the terminal (at some stage it appeared):

(gnome-desktop-item-edit:8998): Gtk-WARNING **: Attempting to store changes into `/root/.local/share/recently-used.xbel', but failed: Failed to create file '/root/.local/share/recently-used.xbel.DSV8LW': No such file or directory

I am using Ubuntu 12.04 x32 and eclipse Juno.

PS. PATH variable points at jdk/bin and JAVA_HOME – to the jdk folder
PSS. I actually set the environment variables through .bashrc file(JAVA_HOME and PATH)

Best Answer

  1. Create a file "eclipse.desktop" or similar, just be sure to have the .desktop extension.
  2. Open File with a texteditor (gedit for instance)
  3. paste following code into the file:

    [Desktop Entry]
    Version=1.0
    Type=Application
    Terminal=false
    Exec=/home/path/to/eclipse/eclipse --clean -vmargs -Dfile.encoding=UTF-8 -Xmx1024m -Xms256m -XX:MaxPermSize=256m
    Name=Eclipse JEE IDE
    Icon=/home/path/to/eclipse/icon.xpm

  4. Be sure to replace "/home/path/to/eclipse/" with your path to your eclipse installation folder.

  5. Save the file

  6. Make the file executable and copy it whereever you want an eclipse starter.

Happy Coding!

Related Question