Saturday, February 21, 2009

Install Java 6 on CentOS 5.2

  1. run /usr/sbin/alternatives --config java, it gives no response.
  2. run uname -m and it gives i386. it means it is a linux not a linux64.
  3. download jdk rpm from java.sun.com, at the time, sun provides JDK 6 Update 12. select the Linux and the rpm.bin
  4. chmod of the bin file and make it executable, run it
  5. Get error -bash: ./jdk-6u12-linux-i586-rpm.bin: /bin/sh: bad interpreter: Permission denied
  6. after some research, i realized that the /tmp is shared managed. it won't allow me to run any scripts there. so i moved the bin file to my home directory and run it, it installed the java automatically
  7. run rpm -qa | grep java and got jdk-1.6.0_12-fcs, run rpm -qa | grep sun also returns a bunch of packages
  8. run /usr/sbin/alternatives --config java, it still gives no response but run java -version, it gives the 1.6.0_12 back.
  9. done.

No comments: