我是靠谱客的博主 虚心鲜花,这篇文章主要介绍CentOS8下使用yum命令安装jdk,现在分享给大家,希望可以做个参考。

复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
[root@node-etl-01 ~]# yum list java-1.8* Last metadata expiration check: 1:51:51 ago on Mon 01 Nov 2021 08:45:42 PM CST. Available Packages java-1.8.0-openjdk.x86_64 1:1.8.0.312.b07-1.el8_4 appstream java-1.8.0-openjdk-accessibility.x86_64 1:1.8.0.312.b07-1.el8_4 appstream java-1.8.0-openjdk-demo.x86_64 1:1.8.0.312.b07-1.el8_4 appstream java-1.8.0-openjdk-devel.x86_64 1:1.8.0.312.b07-1.el8_4 appstream java-1.8.0-openjdk-headless.x86_64 1:1.8.0.312.b07-1.el8_4 appstream java-1.8.0-openjdk-headless-slowdebug.x86_64 1:1.8.0.312.b07-1.el8_4 appstream java-1.8.0-openjdk-javadoc.noarch 1:1.8.0.312.b07-1.el8_4 appstream java-1.8.0-openjdk-javadoc-zip.noarch 1:1.8.0.312.b07-1.el8_4 appstream java-1.8.0-openjdk-slowdebug.x86_64 1:1.8.0.312.b07-1.el8_4 appstream java-1.8.0-openjdk-src.x86_64 1:1.8.0.312.b07-1.el8_4 appstream
复制代码
1
2
3
4
5
6
[root@node-etl-01 ~]# yum install java-1.8.0-openjdk* -y Last metadata expiration check: 1:52:14 ago on Mon 01 Nov 2021 08:45:42 PM CST. Dependencies resolved. ===================================================================================================================================================== Package Architecture Version Repository Size =====================================================================================================================================================
复制代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
[root@node-etl-01 jvm]# cat /etc/profile # /etc/profile # System wide environment and startup programs, for login setup # Functions and aliases go in /etc/bashrc # It's NOT a good idea to change this file unless you know what you # are doing. It's much better to create a custom.sh shell script in # /etc/profile.d/ to make custom changes to your environment, as this # will prevent the need for merging in future updates. pathmunge () { case ":${PATH}:" in *:"$1":*) ;; *) if [ "$2" = "after" ] ; then PATH=$PATH:$1 else PATH=$1:$PATH fi esac } if [ -x /usr/bin/id ]; then if [ -z "$EUID" ]; then # ksh workaround EUID=`/usr/bin/id -u` UID=`/usr/bin/id -ru` fi USER="`/usr/bin/id -un`" LOGNAME=$USER MAIL="/var/spool/mail/$USER" fi # 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 if [ -n "${BASH_VERSION-}" ] ; then if [ -f /etc/bashrc ] ; then # Bash login shells run only /etc/profile # Bash non-login shells run only /etc/bashrc # Check for double sourcing is done in /etc/bashrc. . /etc/bashrc fi fi export LC_ALL=en_US.UTF8 export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.312.b07-1.el8_4.x86_64 export JRE_HOME=$JAVA_HOME/jre export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib/rt.jar export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

 

复制代码
1
2
[root@node-etl-01 jvm]# source /etc/profile
复制代码
1
2
3
4
5
[root@node-etl-01 jvm]# java -version openjdk version "1.8.0_312" OpenJDK Runtime Environment (build 1.8.0_312-b07) OpenJDK 64-Bit Server VM (build 25.312-b07, mixed mode)

最后

以上就是虚心鲜花最近收集整理的关于CentOS8下使用yum命令安装jdk的全部内容,更多相关CentOS8下使用yum命令安装jdk内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(57)

评论列表共有 0 条评论

立即
投稿
返回
顶部