» org.eclipse.emf.ecore.util.EcoreEMap

One error that has bugged my Eclipse PDT for a long time, was org.eclipse.emf.ecore.util.EcoreEMap $DelegateEObjectContainmentEList. A vague error, not much to go on, not many hits on google either. Turned out it had to do with the version of my Java Runtime Environment I was using.

Current Java version in use

You can check what Java Runtime version Ubuntu is using by entering: 

java -version

In my case, it resulted in the following output

java version "1.5.0"
gij (GNU libgcj) version 4.2.3 (Ubuntu 4.2.3-2ubuntu6)

Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Even though I have the original Sun Runtime installed:

root@jade:/home/kevin# dpkg -l |grep jre
ii sun-java6-jre 6-07-3ubuntu2 Sun Java(TM) Runtime Environment (JRE) 6

It was not being used. It was before. I don't know what changed it.

Available Java versions on system

To change it back, I used

sudo update-java-alternatives -l

to show me what candidates were available:

java-6-sun 63 /usr/lib/jvm/java-6-sun
java-gcj 1042 /usr/lib/jvm/java-gcj

Change Java version

I really want to change it back to Sun's version, so I run

sudo update-alternatives --config java

Which will show me

There are 4 alternatives which provide `java'.

Selection Alternative
-----------------------------------------------
1 /usr/bin/gij-4.2
2 /usr/bin/gij-4.1
*+ 3 /usr/lib/jvm/java-gcj/jre/bin/java
4 /usr/lib/jvm/java-6-sun/jre/bin/java

Press enter to keep the default[*], or type selection number:

So I press 4

And this gives me:

Using '/usr/lib/jvm/java-6-sun/jre/bin/java' to provide 'java'.

Confirm Java version

To confirm it is really used, I ask Java it's version again:

java -version

Telling me:

java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Server VM (build 10.0-b23, mixed mode)

Alright, all did go well. When I run Eclipse PDT again, all of my errors are gone.

Thank you Ubuntu

You probably shouldn't follow me


Like this Article?

I'd appreciate it if you leave a comment, spread the word, or consider a small donation


tags: programming, ide, eclipse
category: Howto - Webserver
read: 10,913 times

Add comment

(required, shown)(required, not shown)for syntax highlighting

[CODE="Javascript"]
your_code_here();
[/CODE]

Replace "Javascript"
with "php", "text", etc.
code (to make sure you are not a spammer)

 Track replies: rss feed comments feed

Comments

#10. Kelvin on 25 June 2009

Gravatar.com: KelvinThanks! The eclipse outline for pdt doesn't work without this fix either.

#9. Kevin on 29 May 2009

Twitter.com: kvzIf you like Eclipse, I think you will adore NetBeans : )
http://kevin.vanzonneveld.net/techblog/article/my_new_ide_netbeans/

#8. Farid on 28 May 2009

Gravatar.com: FaridI was going nuts with Eclipse, I installed Oxygen plugin and all sorts of errors where shown, after veryfing the version, I was using 1.5 though I installed sun 1.6, your solution worked perfectly! Thanks man!
Cheers;

#7. guilherme on 02 April 2009

Gravatar.com: guilhermeworks fine! tks!

#6. Kevin on 16 March 2009

Twitter.com: kvz@ Kevin (a different one): Yeah maybe it was an upgrade. Could have been anyway. Thanks for sharing.

#5. Kevin (a different one) on 12 March 2009

Gravatar.com: Kevin (a different one)Thanks for the solution. This was driving me crazy. I upgraded from Hardy to Intrepid and I guess it switched it back to gcj without me noticing.

#4. Mike on 07 January 2009

Gravatar.com: MikeExcellent. Thanks very much. I had the exact same problem and it was driving me crazy until I found your solution.

#3. Cal on 09 November 2008

Gravatar.com: CalThanks Kevin! I too was suddenly having problems with Eclipse and this did the trick. Unfortunately I have no idea what may have changed the Java version in use.

#2. Kevin on 09 November 2008

Twitter.com: kvz@ michele: Yeah I have no idea, I haven't played around with java or anything. Something must have told it to switch versions. But what..

#1. michele on 04 November 2008

Gravatar.com: michelethis article really helped.
I would never have thought that something had rewritten the alternatives symlinks.
maybe some package update?