14

There may well be a very simple answer to this but having googled for an hour, I am resorting to asking here.

I am simply trying to install eclipse Indigo(3.7.2) on Ubuntu 12.04 and get it to let me make a java application.

I have used:

sudo apt-get install eclipse

to get eclipse, which also installs the jdt package needed for making java projects.

However, when I navigate to new -> project, I am not given the option of a java project wizard (see screenshot).

New eclipse project

Anyone know how to fix this?

EDIT: Dowloading the .tar.gz myself and unpacking it seems to have worked fine. I'm not sure why apt-get didn't work.

derekerdmann
  • 17,696
  • 11
  • 76
  • 110
Daniel Graef
  • 201
  • 1
  • 2
  • 6
  • I suspect you downloaded the wrong instance of eclipse. They have a bunch of flavors, not all are for java. What version did you download? – Yevgeny Simkin Jun 14 '12 at 12:39
  • Like I say I just used apt-get, so I presume it picked the right version? I have 32-bit ubuntu 12.04 on my machine and the eclipse version is: 3.7.2 – Daniel Graef Jun 14 '12 at 12:43
  • 1
    Can you check the output of `dpkg --get-selections | grep eclipse` to make sure the `eclipse-jdt` is correctly installed? – Joost Jun 14 '12 at 12:44

7 Answers7

34

Window > Open Perspective > Java

I feel like an idiot for how long it took me to figure this out. It's not very intuitive now, is it? >.<

Jade
  • 349
  • 3
  • 2
12

I was with the same problem. Try doing that:

sudo apt-get update && sudo apt-get upgrade

sudo apt-get remove eclipse
sudo apt-get purge eclipse
rm -r ~/.eclipse
sudo apt-get install eclipse

I didn't need to remove all the locations which showed up on whereis eclipse, like Steve Beer said.

Besides, you can also try doing

sudo apt-get install --reinstall eclipse-jdt

if the previous commands don't work out.

thiagowfx
  • 4,832
  • 6
  • 37
  • 51
4

I had the same issue and was able to resolve it in deleting the entire ~/.eclipse directory along with everything in the workspace of eclipse. When I started eclipse after this, it was again possible to add java projects.

persteffen
  • 41
  • 1
2

I had the same problem and found out it was because I had installed another version of eclipse which I had downloaded manually. I simply removed the package again ("sudo apt-get remove eclipse") and deleted everything concerning eclipse:

  • ~/.eclipse
  • ~/workspace
  • everything that showed up on "whereis eclipse"

and then reinstalled it using "sudo apt-get install eclipse". Worked fine for me.

Steve Beer
  • 1,318
  • 12
  • 16
  • Manual tinkering like this will probably cause your system to lose important information, and that might result in your losing the ability to manage the package via apt-get. I would recommend other methods before doing this, and if you finally decide to do it, proceed with caution. – cangrejo Sep 12 '13 at 12:31
  • Removing eclipse from /usr/lib/eclipse is a BIG mistake. A lot of hastle would follow.... going through fixing this mistake. – amirkavyan Aug 08 '15 at 22:26
1

Make sure that the JDK is installed. sudo apt-get install openjdk-7-jdk

also make sure that the installer is up to date : sudo apt-get update , sudo apt-get upgrade

You have another option. Try downloading eclipse from the Eclipse website www.eclipse.org

download the appropriate version for your machine and try running it from the command line directly yourDownloadPath/eclipse

  • Don't forget to add the executable permission(chmod +x) if necessary

Good luck.

MSaudi
  • 4,442
  • 2
  • 40
  • 65
0

Same as @thiagowfx answered, just need to add * in last commant

sudo apt-get remove eclipse*
sudo apt-get purge eclipse*
rm -r ~/.eclipse*
rm -r workspace*

Then install the eclipse

sudo apt-get install eclipse
leuza
  • 13
  • 4
-1

these both commands completely solved the problem for me:

sudo apt-get install --reinstall eclipse-jdt

sudo apt-get update

Sara M
  • 15
  • 1
  • 3