Tuesday, October 12, 2010

How to Install SUN Java on CentOS 5.5

1. Go to Sun website. http://www.oracle.com/technetwork/java/javase/downloads/index.html

2. From java SE download section , select Java JDK.

3. Choose linux for 32 bit or linux x64 for a 64 bit version from "platform" section and press continute.
a. for 64 bit java
4.wget -c "location of .bin file ". if you are using putty the just right click on the hyper link and "copy link location", then just right click on the putty.
5. ./jdk-6u22-linux-i586.bin?A................. or sh jdk-...whatever version you have downloaded
         5a. copy java from this location to /usr/java
6. alternatives –-install /usr/bin/java java /usr/java/jdk1.6.0_22/bin/java 2

7. alternatives --config java

9.There are 4 programs which provide 'java'.


Selection Command
-----------------------------------------------
1 /usr/lib/jvm/jre-1.4.2-gcj/bin/java
* 2 /usr/lib/jvm/jre-1.6.0-openjdk/bin/java
+ 3 /opt/jdk1.6.0_22/bin/java
4 /usr/java/jdk1.6.0_22/bin/java
Enter to keep the current selection[+], or type selection number: 4

10. check the java installation

sudo java -version
[sudo] password for nkumar:
java version "1.6.0_22"
Java(TM) SE Runtime Environment (build 1.6.0_22-b04)
Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing)


Also install JPackage from http://jpackage.org/yum.php
configure the jpackage repositories in yum Create a new file /etc/yum.repos.d/jpackage.repo
and copy the file from jpackage site.

# yum install -y jpackage-utils


For detailed information please visit

http://wiki.centos.org/HowTos/JavaOnCentOS









 




No comments:

Post a Comment