Установка java на centos 6
1. Качаем дистрибутив Java
Качаем Java со страницы http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html.
# cd /opt/ # wget http://download.oracle.com/otn-pub/java/jdk/7u25-b15/jdk-7u25-linux-i586.tar.gz
Раскрываем архив:
# tar xzf jdk-7u25-linux-i586.tar.gz
2. Устанавливаем Java
# cd /opt/jdk1.7.0_25 # alternatives --install /usr/bin/java java /opt/jdk1.7.0_25/bin/java 2 # alternatives --config java There is 1 program that provides 'java'. Selection Command ----------------------------------------------- *+ 1 /opt/jdk1.7.0_25/bin/java Enter to keep the current selection[+], or type selection number: 1
3. Проверяем версию
# java -version
java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) Client VM (build 23.25-b01, mixed mode)
4. Устанавливаем переменные окружения
- Устанавливаем переменную JAVA_HOME
# export JAVA_HOME=/opt/jdk1.7.0_25
# export JRE_HOME=/opt/jdk1.7.0_25/jre
# export PATH=$PATH:/opt/jdk1.7.0_25/bin:/opt/jdk1.7.0_25/jre/bin