jdk 설치
[root@localhost ~]# rpm -qa | grep java
[root@localhost ~]# yum -y remove java
[root@localhost ~]# cd /data
[root@localhost data]# tar zxvf jdk-8u112-linux-x64.tar.gz
[root@localhost data]# mv jdk1.8.0_112 /usr/local/
[root@localhost data]# cd /usr/local/
[root@localhost local]# ln -s jdk1.8.0_112 java
[root@localhost local]# vi /etc/bashrc (/etc/profile에 설정해도 무관)
...##최하단에 아래 내용 추가
JAVA_HOME=/usr/local/java
CLASSPATH=.:$JAVA_HOME/lib/tools.jar
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME CLASSPATH PATH
[root@localhost local]# source /etc/bashrc
[root@localhost local]# java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
** 만약 설치가 안될 경우 java 설치 전에 glibc.i686을 설치해본다.
[root@localhost local]# yum -y install glibc.i686
jre 설치
[root@localhost data]# rpm -qa | grep java
[root@localhost data]# yum -y remove java
[root@localhost data]# tar zxvf jre-7u79-linux-x64.tar.gz
[root@localhost data]# mkdir /usr/local/java
[root@localhost data]# mv jre1.7.0_79 /usr/local/java
[root@localhost data]# cd /usr/local/java
[root@localhost java]# ls
jre1.7.0_79
[root@localhost java]# ln -s jre1.7.0_79 jre
[root@localhost java]# vi /etc/profile
...
(최하단에 아래내용 입력)
JAVA_HOME=/usr/local/java/jdk
JRE_HOME=/usr/local/java/jre
CLASSPATH=.:$JAVA_HOME/lib/tools.jar
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME JRE_HOME CLASSPATH PATH
[root@localhost java]# source /etc/profile
[root@localhost java]# java -version
java version "1.7.0_79"
Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
[root@localhost java]# javac -version
javac 1.7.0_79
'Linux > 구축 관련' 카테고리의 다른 글
CentOS에서 USB 사용하기 (FAT32, NTFS) (0) | 2016.11.30 |
---|---|
Eclipse 설치 (0) | 2016.11.18 |
Multipath 구성 (0) | 2016.11.10 |
Logrotate (0) | 2016.11.04 |
vsftp를 이용한 ftp 환경 구축 (0) | 2016.08.25 |