centos7 安装JDK8

2020-03-31  本文已影响0人  凌雲木

本文主要说明了在centos7系统下安装JDK8的详细步骤

[root@iZipqoqa9axzz1Z java]# ll
total 190576
drwxr-xr-x 7 10143 10143      4096 Dec 11 18:52 jdk1.8.0_241
-rw-r--r-- 1 root  root  195143852 Mar 30 16:56 jdk-8u241-linux-i586.tar.gz
[root@iZipqoqa9axzz1Z java]# 

删除安装包rm -rf jdk-8u241-linux-i586.tar.gz(删除时输入 jdk-后,再按Tab键自动补全jdk安装包名字)
删除后查看目录:

[root@iZipqoqa9axzz1Z java]# ll
total 4
drwxr-xr-x 7 10143 10143 4096 Dec 11 18:52 jdk1.8.0_241

# Path manipulation
if [ "$EUID" = "0" ]; then
    pathmunge /usr/sbin
    pathmunge /usr/local/sbin
else
    pathmunge /usr/local/sbin after
    pathmunge /usr/sbin after
fi

HOSTNAME=`/usr/bin/hostname 2>/dev/null`
HISTSIZE=1000
if [ "$HISTCONTROL" = "ignorespace" ] ; then
    export HISTCONTROL=ignoreboth
else
    export HISTCONTROL=ignoredups
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL

# By default, we want umask to get set. This sets it for login shell
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 199 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then
    umask 002
else
    umask 022
fi

for i in /etc/profile.d/*.sh /etc/profile.d/sh.local ; do
    if [ -r "$i" ]; then
        if [ "${-#*i}" != "$-" ]; then
            . "$i"
        else
            . "$i" >/dev/null
        fi
    fi
done

unset i
unset -f pathmunge
# Path manipulation
if [ "$EUID" = "0" ]; then
    pathmunge /usr/sbin
    pathmunge /usr/local/sbin
else
    pathmunge /usr/local/sbin after
    pathmunge /usr/sbin after
fi

HOSTNAME=`/usr/bin/hostname 2>/dev/null`
HISTSIZE=1000
if [ "$HISTCONTROL" = "ignorespace" ] ; then
    export HISTCONTROL=ignoreboth
else
    export HISTCONTROL=ignoredups
fi

export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL

# By default, we want umask to get set. This sets it for login shell
# Current threshold for system reserved uid/gids is 200
# You could check uidgid reservation validity in
# /usr/share/doc/setup-*/uidgid file
if [ $UID -gt 199 ] && [ "`/usr/bin/id -gn`" = "`/usr/bin/id -un`" ]; then
    umask 002
else
    umask 022
fi

for i in /etc/profile.d/*.sh /etc/profile.d/sh.local ; do
    if [ -r "$i" ]; then
        if [ "${-#*i}" != "$-" ]; then
            . "$i"
        else
            . "$i" >/dev/null
        fi
    fi
done

unset i
unset -f pathmunge
-- INSERT --                                                                                                                                                                  78,1          Bot

移动光标在最下方填上:

JAVA_HOME=/fcj/java/jdk1.8.0_241

CLASSPATH=$JAVA_HOME/lib/

PATH=$PATH:$JAVA_HOME/bin
[root@iZipqoqa9axzz1Z java]# java -version 
java version "1.8.0_241"
Java(TM) SE Runtime Environment (build 1.8.0_241-b07)
Java HotSpot(TM) Server VM (build 25.241-b07, mixed mode)
[root@iZipqoqa9axzz1Z java]# 
上一篇下一篇

猜你喜欢

热点阅读