1. 安裝前的準備
1.1 安裝環境
1.1.1 作業系統內核版本
[root@localhost ~]# uname -a
Linux localhost.localdomain 3.10.0-1160.el7.x86_64 #1 SMP Mon Oct 19 16:18:59 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
1.1.2 作業系統發行版本
[root@localhost ~]# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)
1.2 安裝檔案
1.2.1 安裝檔案下載
- 官網地址:https://www.oracle.com/java/
- 下載地址:https://www.oracle.com/java/technologies/javase-downloads.html
- 下載地址(快捷):https://www.oracle.com/java/technologies/javase/javase-jdk8-downloads.html
1.2.2 安裝檔案串列
- jdk-8u301-linux-x64.rpm
2. 安裝和配置
2.1 軟體安裝
2.1.1 安裝前的檢測
- 查看運行行程
[root@localhost ~]# rpm -qa | grep jdk
jdk1.8-1.8.0_271-fcs.x86_64
2.1.2 安裝JDK
- 切換至軟體目錄;
[root@localhost ~]# cd /home/Software/JDK/
[root@localhost JDK]# ls
jdk-8u301-linux-x64.rpm
- 安裝“jdk-8u301-linux-x64.rpm”,
[root@localhost JDK]# sudo yum install -y jdk-8u301-linux-x64.rpm
Loaded plugins: fastestmirror, langpacks
Examining jdk-8u301-linux-x64.rpm: 2000:jdk1.8-1.8.0_301-fcs.x86_64
Marking jdk-8u301-linux-x64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package jdk1.8.x86_64 2000:1.8.0_301-fcs will be installed
--> Finished Dependency Resolution
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"
Dependencies Resolved
==================================================================================================================================================================
Package Arch Version Repository Size
==================================================================================================================================================================
Installing:
jdk1.8 x86_64 2000:1.8.0_301-fcs /jdk-8u301-linux-x64 253 M
Transaction Summary
==================================================================================================================================================================
Install 1 Package
Total size: 253 M
Installed size: 253 M
Downloading packages:
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows:
icedtea-web-1.7.1-2.el7_6.x86_64 has missing requires of java-1.8.0-openjdk
jline-1.0-8.el7.noarch has missing requires of java >= ('0', '1.5', None)
Installing : 2000:jdk1.8-1.8.0_301-fcs.x86_64 1/1
Unpacking JAR files...
tools.jar...
plugin.jar...
javaws.jar...
deploy.jar...
rt.jar...
jsse.jar...
charsets.jar...
localedata.jar...
Verifying : 2000:jdk1.8-1.8.0_301-fcs.x86_64 1/1
Installed:
jdk1.8.x86_64 2000:1.8.0_301-fcs
Complete!
2.2 軟體配置
2.2.1 修改環境變數
- 配置環境變數;
[root@localhost ~]# vim /etc/profile
unset i
unset -f pathmunge
export JAVA_HOME=/usr/java/jdk1.8.0_301-amd64
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
- 環境變數生效,
[root@localhost ~]# source /etc/profile
- 查看環境變數
[root@localhost ~]# env
JAVA_HOME=/usr/java/jdk1.8.0_301-amd64
PATH=$JAVA_HOME/bin:$PATH
CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
(特別說明:環境變數位置為隨機分布)
3. 啟動和驗證
3.1 軟體啟動
暫無,
3.2 軟體驗證
3.2.1 查看軟體版本
[root@localhost ~]# java -version
java version "1.8.0_301"
Java(TM) SE Runtime Environment (build 1.8.0_301-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.301-b09, mixed mode)
4. 停止和卸載
4.1 軟體停止
暫無,
4.2 軟體卸載
- 檢測庫檔案是否存在
[root@localhost ~]# rpm -qa | grep jdk
jdk-11.0.12-11.0.12-ga.x86_64
- 依次卸載軟體檔案
[root@localhost ~]# rpm -e jdk-11.0.12-11.0.12-ga.x86_64 --nodeps
引數選項:
rpm -e jdk 普通洗掉模式
rpm -e --nodeps 強力洗掉模式,如果使用上面命令洗掉時,提示有依賴的其他檔案,則 用該命令可以對其進行強力洗掉,
5. 安裝目錄和核心檔案
5.1 安裝目錄
[root@localhost ~]# cd /usr/java/jdk1.8.0_301-amd64
[root@localhost jdk1.8.0_301-amd64]# ls
bin include jmc.txt legal LICENSE README.html src.zip THIRDPARTYLICENSEREADME.txt
COPYRIGHT javafx-src.zip jre lib man release THIRDPARTYLICENSEREADME-JAVAFX.txt
5.2 執行檔案
5.3 組態檔
5.4 日志檔案
6. 常見問題
6.1 1#問題
6.2 2#問題
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/302921.html
標籤:其他
上一篇:資源中心——連接池調優
