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
- [Linux7] zabbix 3.2.11安裝Linux
- JDK安裝JDK
- 安裝JDKJDK
- JDK安裝和解除安裝JDK
- Mac 安裝 JDKMacJDK
- CentOS安裝jdkCentOSJDK
- 安裝文件-JDKJDK
- Ubuntu 安裝 JDKUbuntuJDK
- CentOS 安裝 JDKCentOSJDK
- JDK 解除安裝JDK
- JDK安裝(轉)JDK
- linux7上安裝RAC的問題Linux
- JDK的安裝與解除安裝JDK
- JDK安裝教程win10 jdk壓縮包安裝教程JDKWin10
- Windows上安裝JDKWindowsJDK
- Ubuntu下JDK安裝UbuntuJDK
- Centos 7 安裝JDKCentOSJDK
- CentOS如何安裝JDKCentOSJDK
- jdk安裝與配置JDK
- Ubuntu 安裝 Java JdkUbuntuJavaJDK
- Ubuntu安裝配置JDKUbuntuJDK
- linux 安裝jdkLinuxJDK
- CentOS 安裝sun jdkCentOSJDK
- Linux安裝JDKLinuxJDK
- centos 安裝 jdk 8CentOSJDK
- JDK的安裝配置JDK
- JDK17安裝JDK
- linux 解除安裝jdk和安裝LinuxJDK
- linux7 靜默安裝 11GR2 RACLinux
- 【 Linux 軟體安裝 】- 1 JDK安裝LinuxJDK
- Linux下JDK安裝與解除安裝LinuxJDK
- 使用CentOS 7.5解除安裝自帶jdk安裝自己的JDK1.8CentOSJDK
- ubuntu安裝jdk問題UbuntuJDK
- MAC中安裝JDK、MavenMacJDKMaven
- 安裝jdk的步驟JDK
- ubuntu下安裝oracle JDKUbuntuOracleJDK
- Jdk8的安裝JDK