11.11.08

Trouble with Eclipse Execution Environments

Posted in Programming, Technology at 9:23 am by Todd

Developing software is a very tough business. But days like this make me believe that the world would be better off without software! For two days I have fought a very simple but elusive issue in Eclipse. Basically, when I installed Eclipse it wasn’t picking up any execution environments so no project would compile nor run. A screenshot of the empty Execution Environments screen is below.

Empty Execution Environment

Empty Execution Environment

I first thought this would be an easy problem to fix so I used the world brain. When that failed, I had to actually use my brain. It turns out, Eclipse gathers information about JREs available and stores that information in a configuration file (libraryInfos.xml in the .metadata/.plugins/org.eclipse.jdt.launching/ directory inside the newly created workspace). And I think this auto-generation is where the bug lies. Specifically, when Eclipse grabs the version information from a newly added JRE/JDK it can get corrupted. When it works correctly the Execution Environments screen looks like the following. FYI, in this case I used the Sun JDK 1.6 to run Eclipse.

Available Execution Environment

Available Execution Environment

Installed JREs

Here is a snippet of the libraryInfos.xml file when the bug is visible:
<libraryInfo home="/opt/sun-jdk-1.6.0.07" version="CompilerOracle: exclude org/eclipse/core/internal/dtree/DataTreeNode.forwardDeltaWith
1.6.0_07"> and here is a similar snippet when the bug is not visible:
<libraryInfo home="/opt/sun-jdk-1.6.0.07" version="1.6.0_07"> Notice that the version information is pretty funny looking?

And it looks like it is connected to the .hotspot_compiler file that I am using. The contents of it are:
exclude org/eclipse/core/internal/dtree/DataTreeNode forwardDeltaWith
which causes the following to be printed on the command line when Eclipse starts:
CompilerOracle: exclude org/eclipse/core/internal/dtree/DataTreeNode.forwardDeltaWith

So I assume this is a bug since it would be a crazy feature. My work-around is to move (or rename) the .hotspot_compiler file the first time I run the new Eclipse. I then add the Java JREs, close down Eclipse, move the .hotspot_compiler file back, and then restart Eclipse. Once the JREs are added the issue no longer persists (unless new JREs are added).

2 Comments

  1. the_doze said,

    November 12, 2008 at 3:23 pm

    Interesting… now let’s see some more pics of that moustache. :)

  2. Todd said,

    November 12, 2008 at 5:45 pm

    I am glad you found that so interesting. Shall I go into more details about how the JVM loads that information using the stack, heap, and pixie dust?

    More pictures are on the way. Didn’t you mom ever teach you patience?