Posts Tagged ‘fedora’

Installing Sun Java as alternative to IcedTea/OpenJDK in Fedora

Thursday, July 23, 2009

Ever wondered why Eclipse PDT 2.1 does autocomplete so slow? Installing proper Java Runtime Environment might help. Here’s how:

  1. Go to http://java.com
  2. Click on that big, blue Free Java Download button in the middle of the screen
  3. Download Linux RPM (self-extracting file), it will download a .bin file that then needs to be extracted to get actual rpm package (that’s what I call convenience)
  4. Install rpm file as usual
  5. Then, as root execute:
    alternatives --install /usr/bin/java java /usr/java/latest/bin/java 20000

That’s kind of it. To check if new Java installation is now default alternative, you might execute this:

[root@m4300 ~]# alternatives --config java

There are 3 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
   1           /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
   2           /usr/lib/jvm/jre-1.5.0-gcj/bin/java
*+ 3           /usr/java/latest/bin/java

Little *+ sign, as you would expect, means the default choice.

Credits:
matulka.net

PS. Unfortunately Eclipse PDT 2.1 is still slow on autocomplete. :(