Linux7安裝JDK
1. 檢查並刪除Linux自帶的JDK依賴
java -version
如下:
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)
檢視JDK依賴包
rpm -qa | grep java
javapackages-tools-3.4.1-11.el7.noarch
java-1.8.0-openjdk-1.8.0.242.b08-1.el7.x86_64
python-javapackages-3.4.1-11.el7.noarch
tzdata-java-2019c-1.el7.noarch
java-1.8.0-openjdk-headless-1.8.0.242.b08-1.el7.x86_64
刪除除了.noarch的其它檔案
rpm -e --nodeps java-1.8.0-openjdk-headless-1.8.0.242.b08-1.el7.x86_64
rpm -e --nodeps java-1.8.0-openjdk-1.8.0.242.b08-1.el7.x86_64
如果刪除失敗可以切換root使用者
su -root
輸入密碼
2.安裝JDK
下載linux版本JDK
解壓
tar -zxvf jdk-8u271-linux-x64.tar.gz
編輯profile檔案
vim /etc/profile
按 i
鍵,在最後面輸入如下內容
export JAVA_HOME=/diskE/jdk1.8.0_271
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=CLASSPATH=.:${JAVA_HOME}/jre/lib/rt.jar:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar
按esc鍵,輸入:wq
儲存退出
重新載入profile檔案
source /etc/profile
java -version
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)
java
javac
相關文章
- CentOS Linux7 安裝JDKCentOSLinuxJDK
- JDK安裝JDK
- 安裝JDKJDK
- JDK安裝和解除安裝JDK
- CentOS 安裝 JDKCentOSJDK
- Linux安裝JDKLinuxJDK
- Mac 安裝 JDKMacJDK
- 安裝文件-JDKJDK
- CentOS安裝jdkCentOSJDK
- JDK的安裝與解除安裝JDK
- linux 解除安裝jdk和安裝LinuxJDK
- linux7 靜默安裝 11GR2 RACLinux
- JDK安裝教程win10 jdk壓縮包安裝教程JDKWin10
- 【 Linux 軟體安裝 】- 1 JDK安裝LinuxJDK
- Centos 7 安裝JDKCentOSJDK
- CentOS如何安裝JDKCentOSJDK
- Linux安裝JDK流程LinuxJDK
- centos 安裝 jdk 8CentOSJDK
- jdk安裝與配置JDK
- Windows上安裝JDKWindowsJDK
- linux 下安裝 jdkLinuxJDK
- JDK17安裝JDK
- JDK的安裝配置JDK
- Ubuntu下JDK安裝UbuntuJDK
- 使用CentOS 7.5解除安裝自帶jdk安裝自己的JDK1.8CentOSJDK
- ubuntu安裝jdk問題UbuntuJDK
- Jdk8的安裝JDK
- centos安裝jdk8CentOSJDK
- Linux安裝JDK1.8LinuxJDK
- MAC中安裝JDK、MavenMacJDKMaven
- Linux安裝jdk環境LinuxJDK
- Linux 安裝 JDK17LinuxJDK
- 在Linux下安裝JDKLinuxJDK
- 安裝jdk的步驟JDK
- Linux下jdk的安裝解除安裝切換LinuxJDK
- Linux下檢視jdk安裝路徑版本、安裝jdk、配置環境變數LinuxJDK變數
- oracle11g在linux7的靜默安裝指令碼OracleLinux指令碼
- CenOS 7下安裝jdk 8JDK