Total Eclipse in Gentoo

Gentoo does really have Eclipse SDK in its portage. I once used it a long time ago and I gave up soon after I learned that it’s more difficult to update the portage version of Eclipse (at least to me).

Now I decided to install Eclipse Europa, and grabbed myself a Gtk version of Europa and extracted in /opt.

When when /opt/eclipse/eclipse was started, Eclipse stopped the execution, giving me the following error message.

It seemed like vanilla Eclipse didn’t really want to work with Gentoo’s Java environment.

So I added a path to Java VM when starting Eclipse, and it began to work.
[code lang=”bash”]./eclipse -vm java-config-2 --java[/code]
It was because eclipse was running Gentoo’s run-java-tool instead of java, and this made $tool variable in line 15 of run-java-tool to become “run-java-tool” instead of “java”. Then it leads to wrong interpretation of JVM path.

It can also be fixed by adding
[code lang=”bash”][[ $tool = “run-java-tool” ]] && tool=”java”[/code]

(replace & with actual ampersand symbol)
after line 15,
[code lang=”bash”]tool=$(basname $O)[/code]

Or alternatively, you can directly call Equinox (Eclipse Launcher) by using the examples described in Eclipse Wiki. Here’s the sample bash script: