How To Load JAVA Rpms On Linux Server
How To Load JAVA Rpms On Linux Server
-- Check using following command # rpm -qa | grep java -- This is another command to know which version .. also it tell you about 32bit or 64bit # rpm -qa --queryformat "%{NAME}-%{VERSION}-%{RELEASE} (%{ARCH})\n" | grep java -- Normally we store JAVA related rpms under /usr/local -- so create JAVA folder and ftp rpms from downloaded server -- We have downloaded java_rpms on 10.240.82.123 # cd /usr/local/java # cd /usr/local # mkdir java # cd java # ftp 10.240.82.123 # cd .. # ls # ls -lst java_rpms/ # ls -- Once FTP is over go to that folder on that server where you want to load new version # cd java_rpms/ -- Make the binary file executable using chmod a+x command so that we can run it. # chmod a+x jdk-6u22-linux-i586.bin -- Now run the file # ./jdk-6u22-linux-i586.bin
-- Check the extracted directory ... it would have created the folder of the same file name # ls -lst # cd .. # cd java # mv ../java_rpms/jdk1.6.0_22/ . # cd jdk1.6.0_22/ # ls # cd jre/ # pwd -- This is another version you have kept under folder -- and then you can export JAVA_HOME variable to point to this folder -- So you can hava both versions ( eg. 1.4 as well as 1.6 on the system ) # java -version # man rpm # cd .. # ls # find . -name *.rpm -print # cd .. # find . -name *install* -print # pwd # cd jdk1.6.0_22/ # cd /usr/lib # cd jvm # ls # pwd -- Now to permanantly install the latest version -- You need to execute following commands in given sequence only -# mv /usr/local/java/jdk1.6.0_22/ . -- Following commands will prompt you both the versions and allow you to set the required -- version --
# update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_22/bin/java" 1 # update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_22/bin/javac" 1 # update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_22/bin/javaws" 1 -- Last configuration of java -# update-alternatives --config java # java -version # update-alternatives --config javac # update-alternatives --config javaws # exit