Posted on July 15, 2011
How to install Eclipse 3.7 on Ubuntu 11.04
The Eclipse packages in Ubuntu are are very out of date. The latest version in the Ubuntu repos is 3.5.2 where as the latest version of Eclipse is 3.7. I’m posting this because Ubuntu 11.04 uses the new Unity desktop which uses overlay-scrollbars (scrolls bars that are hidden until you hover over them). For some reason Eclipse 5.3.2 doesn’t like to play nice with the overlay scrollbars, and I’d rather use the newest version anyways. With Eclipse, you can just download the tar.gz file from eclipse.org and run it no problem, but I like set things up in a cleaner fashion, so here’s how I did it.
1) Download Eclipse. I got eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz
2) Extract it
tar xzf eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz
Or just be lazy and Right Click > Extract Here
3) Move to /opt/ folder
mv eclipse /opt/ sudo chown -R root:root eclipse sudo chmod -R +r eclipse
4) Create an eclipse executable in your path
sudo touch /usr/bin/eclipse sudo chmod 755 /usr/bin/eclipse sudo nano /usr/bin/eclipse
copy this into nano
#!/bin/sh #export MOZILLA_FIVE_HOME="/usr/lib/mozilla/" export ECLIPSE_HOME="/opt/eclipse" $ECLIPSE_HOME/eclipse $*
save the file (^O = Ctrl+o) and exit nano (^X = Ctrl+x)
5) Create a gnome menu item
sudo nano /usr/share/applications/eclipse.desktop
copy this into nano
[Desktop Entry] Encoding=UTF-8 Name=Eclipse Comment=Eclipse IDE Exec=eclipse Icon=/opt/eclipse/icon.xpm Terminal=false Type=Application Categories=GNOME;Application;Development; StartupNotify=true
save and exit nano
6) Launch Eclipse for the first time
/opt/eclipse/eclipse -clean &
Thanks alot man.
I switched to Ubuntu recently.
Your walkthrough helped me a lot to install eclipse in a “Natty Narwale” style ;)
bash: /opt/eclipse/eclipse: cannot execute binary file
I got that error message after following all the procedure!
Have you set the proper permission?
sudo chmod 755 /opt/eclipse/eclipse
Got the same error, no permission problems. Can’t figure out whats wrong.
It’s highly probable, that you are using x86 system and try to use x64 eclipse. Download eclipse version form Linux 32 Bit instead of 64 Bit – it should help.
It worked perfectly. Thanks a lot, man.
Hello, I will give it a try. One small correction: The Ubuntu version is 3.5.2 not 5.3.2. I just updated from 10.04 -> 10.10 -> 11.04. Now my Eclipse projects are hosed. So, I’m going to follow your instructions here. Thanks for doing the hard work!
Good catch, and I hope it worked for you
Hey, once again thanks for the info. I finally ended up creating a new VM with 10.04. I found 11.04 would not change the monitor correctly. I went back to this page since I do want to use the latest eclipse. I actually used eclipse for work back in 2005. Now I just want to do some Android work. Here is a site I found somewhat true: http://www.ihateeclipse.com/
excellent work it worked perfectly on Ubuntu 10.10.
Thanks very much. It works a treat. I am using Ubuntu 11.04, is there anyway to make the launch bar icon change from the question mark to the actual eclipse icon.
Did you create this file “/usr/share/applications/eclipse.desktop”? Because in there you set the icon with the line “Icon=/opt/eclipse/icon.xpm”
Hmm, I’m also running 11.04 and the Unity desktop and the icon doesn’t display for me also.
Also, what is the ‘# export MOZILLA_FIVE_HOME …’ line for? Isn’t this a comment? I’ve left it out …
Best wishes
J.
Correction. My version is 11.10.
Having a trawl around there seems to be lots of discussion about changing launcher bar in Unity – the different solutions often seem to be deprecated, such as right clicking the desktop. I think this may have to wait a while …
Fixed. This is working in Unity on Ubuntu 11.10.
I set the environment variables in /etc/environment
MOZILLA_FIVE_HOME has something to do with Eclipse SWT, not sure what though.
Didn’t use categories tag in .desktop file.
The icon wasn’t showing at first because I’d moved eclipse into the wrong directory.
See https://help.ubuntu.com/community/EclipseIDE
thx
MOZILLA_FIVE_HOME is a nightmare… When you hover over a function, you get some documentation. Or maybe you’re typing something and Eclipse makes some suggestions. That window where it displays the information is rendered from the Mozilla browser (I believe). I had problems with it a few months ago: http://stackoverflow.com/questions/6817014/documentation-in-eclipse-shows-up-as-html
thanks a lot – it just works
It say it can’t find the file “mv: cannot stat `eclipse’: No such file or directory” where should the file be? I have try everything and it doesn’t work. Please Help! And Thanks anyone who help :)
I DID IT!!! I DID WOOOTT!!!! WOOOTT!!!!
how you did it can you explain it??
Pingback: How to install Eclipse 3.7 on Ubuntu 11.04 | Kavin-Zhao
Thanks a lot man worked like a charm.
good!thanks a lot
Should the first line in Step #3 be:
sudo mv eclipse /opt/
Thanks for the clear step-by-step!
Ditto
True!
Thanks lot.
Thanks!
thanks!
– @caravaggisto
Thanks .. Worked fine.
Hi,
Will this setup work on 10.04? I am using 10.04 and the only place it is creating problem is in creating the gnome menu item. It says the file does not exists.
Great job, thanks a lot !
I follow your instructions but I still couldn’t run eclipse.How can I manually remove it so I can reinstall it again.
Thank you! Your instructions were concise and accurate. Worked flawlessly.
Just a quick comment – you might want to include ‘sudo’ in step 6.
i.e. “sudo /opt/eclipse/eclipse -clean &”
Woops, it seems I missed a step! No need for the sudo :) You may need some extra ‘cd’ commands though to go from (presumably ‘/home//Downloads’ to ‘/opt’ for the modifications to ‘/opt/eclipse’
thanks man you are the guy thanks now i want to know if u can help me again installing the netbeans it says no JVM found… but i have already installed the JDK7…. some help please?
Definitely a huge help. Thanks!
cool! it works !!
How do you uninstall this, this is not the right version I need
Ok. I did it. I just don’t understand why the ownership has to go to root. I can’t even enter the folder after I did that. Can anyone explain please. Everybody is very happy. Probably I just don’t get it. :(
I saw it. I had to do
sudo chmod -R +x /opt/eclipse/
so now I can access it and use my eclipse and root is the owner.
I kinda got the idea. Now I can only read and execute eclipse, cannot change anything in it , therefore crash it bigtime i suppose.
Thanks for the tutorial :) learned a lot from it :)
Swear to god the first *nix guide ive read where everything went acording to plan..
Thanks dude….
Man, I feel exactly in the same way. Thanks to author!
Thanks a lot! Everything’s fine, the only suggestion is to use “sudo mv eclipse /opt/” except “mv eclipse /opt/” (I’ve tried on Linux Mint 11).
Thanks to you, now I can try Java 7 in Eclipse (earlier it was impossible, even though I had installed both openjdk 7 and Oracle jdk 7 and set one of them as default JRE, but couldn’t set “compiler compilance level” to a higher value then 1.6).
How to uninstall ?
Just delete the directory /opt/eclipse/
You should also nuke
/usr/share/applications/eclipse.desktop
/usr/bin/eclipse
for a cleaner removal
Note that Ubuntu 11.10 has Eclipse 3.7 packages.
Thank you ..it has worked for 11.10 too!!
Thanks for this guide, I was wondering, is it possible to have 32bit eclipse version next to a 64bit version? I think it can, but what lines do I need to replace?
Just the “eclipse” lines to “eclipse32” ?
Thank you so much, It worked fine, thanks a lot friend
It’s a relief to find someone who can explain things so well
Again, thank you. Too bad there is not an Eclipse repository that would simplify this.
This tutorial was instrumental in my learning some basic Linux and bash functions. I kept having errors when I would try to install plug-ins, until I changed ownership of the /opt/eclipse folder from root to my user. The error that Eclipse gave me appeared to have nothing to do with ownership, but said that certain Maven dependencies could not be found. I was able to confirm that the dependencies actually were installed. Finally, it occurred to me that maybe Eclipse was looking for those dependencies in the root folder, rather than the opt/eclipse folder. The program installs plug-ins without a hitch after that change.
I have seen other advice to install Eclipse in the home directory, which could have the benefit of not having to navigate around ownership issues.
Thanks for the tips. No longer intimidated by the bash!
Ric
Hi. Thank you very much. It really helps a lot. I didi it. Would you please let me know how you have learned all these codes?
Best Regards
Thank You so much man .. that was really easy and quick
You are good Carlin
Thanks a lot!
This works fine!
I have a problems in last stage.
when a run a command.
‘/opt/eclipse/eclipse -clean &’
I found
‘/opt/eclipse$ /opt/eclipse/eclipse
bash: /opt/eclipse/eclipse: cannot execute binary file’
what is solution for this?
Hi. First thank you for tutorial, but I have this problem and i don’t know how to solve it when I execute the desktop file :S
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:
/opt/eclipse/jre/bin/java
java in your current PATH
Hey, I had the same issue. Check this out:
https://help.ubuntu.com/community/EclipseIDE#No_Java_Virtual_Machine_found
Here’s some more info…
Make sure you don’t already have java installed. To check, look in /usr/lib/jvm. If you see something there, . If not, check the results of these commands:
$ dpkg -l '*jdk*'
$ dpkg -l '*java*
If you see something like:
un openjdk-7-jre (no description available)
...
un sun-java6-jre (no description available)
with the
un
at the beginning, it means they’re not installed. To remedy that just run apt-get on either openjdk or sun-java (I did openjdk):$ sudo apt-get install openjdk-7-jdk
()
If you’d rather install the JDK from Sun (rather than the open version), .
Hope this helps!
-@caravaggisto
Sorry for the HTML formatting errors. Redux:
Make sure you don’t already have java installed. To check, look in /usr/lib/jvm. If you see something there, try this. If not, check the results of these commands:
$ dpkg -l '*jdk*'
$ dpkg -l '*java*
If you see something like:
un openjdk-7-jre (no description available)
...
un sun-java6-jre (no description available)
with the
un
at the beginning, it means they’re not installed. To remedy that just run apt-get on either openjdk or sun-java (I did openjdk):$ sudo apt-get install openjdk-7-jdk
(credit)
If you’d rather install the JDK from Sun (rather than the open version), then check this.
Hope this helps!
–@caravaggisto
I’m on Ubuntu 11.10 and followed all steps in the original post. The application icon shows up under the Dash home’s More Apps menu, and can be run that way or from the terminal. Unfortunately, when I run it either way, Eclipse doesn’t show up in the side bar, and can’t be alt-tabbed to either (but Eclipse is running and I can click into it and do work). Any ideas, or was I not making sense?
huh, everything seems fine after a reboot… thanks!
Vielen Danke Man… :)
thanx alot….
Very useful, thanks a lot from Holland
thank you very much.
I have already installed eclipse by following your guild.
Thanks man, just worked smoothly.
Thank you so much! worked perfectly.