JP 的个人资料Wireless Earth, wireless...照片日志列表 工具 帮助
8月8日

Replace GCJ with Sun JDK on Redhat Linux

For Redhat Linux installation, both EL and Fedora, GCJ is installed as the default JDK. But GCJ can not catch up with Sun JDK. So I have to install Sun manually again and again.

Install Sun JDK itself is pretty easy, just go to http://java.sun.com to download either an RPM BIN package or a BIN package, run it, then done.

What's really need to google and remember is that, switch from GCJ to Sun JDK.

# /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_02/bin/java 2

# /usr/sbin/alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           /usr/lib/jvm/jre-1.4.2-gcj/bin/java
   2           /usr/java/jdk1.6.0_02/bin/java

Enter to keep the current selection[+], or type selection number: 2

# java -version

java version "1.6.0_02"
Java(TM) SE Runtime Environment (build 1.6.0_02-b05)
Java HotSpot(TM) Client VM (build 1.6.0_02-b05, mixed mode, sharing)