linux安装jdk

Posted 枫-

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux安装jdk相关的知识,希望对你有一定的参考价值。

参考:

https://www.cnblogs.com/xuliangxing/p/7066913.html

https://www.cnblogs.com/shihaiming/p/5809553.html

 

[root@S131922 /]# cd /usr/java/
[root@S131922 java]# ls
jdk1.8.0_211  jdk-8u211-linux-x64.tar.gz
[root@S131922 java]# cd /
[root@S131922 /]# vim /etc/profile
[root@S131922 /]# java -version
java version "1.8.0_211"
Java(TM) SE Runtime Environment (build 1.8.0_211-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.211-b12, mixed mode)
[root@S131922 /]#

    pathmunge /sbin after
fi

HOSTNAME=`/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 ] && [ "`id -gn`" = "`id -un`" ]; then
    umask 002
else
    umask 022
fi       
          
for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
        if [ "${-#*i}" != "$-" ]; then
            . "$i"
        else
            . "$i" >/dev/null 2>&1
        fi
    fi
done
    
unset i
unset -f pathmunge
JAVA_HOME=/usr/java/jdk1.8.0_211
JRE_HOME=${JAVA_HOME}/jre
CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib:$CLASSPATH
JAVA_PATH=${JAVA_HOME}/bin:${JRE_HOME}/bin
PATH=$PATH:${JAVA_PATH}

"/etc/profile" 84L, 1909C           

 

以上是关于linux安装jdk的主要内容,如果未能解决你的问题,请参考以下文章

Linux安装JDK

linux环境下安装jdk

linux怎么配置rpm版jdk环境

jdk-7u3-linux-x64.rpm怎么安装

如何在linux中安装jdk.rpm

在linux下安装jdk,按照网上教程的步骤,却一直不成功