ubuntu 安装 JDK

ubuntu 安装 JDK

  • 1,ubuntu 安装 JDK

1,ubuntu 安装 JDK

# wget https://download.java.net/java/GA/jdk13.0.2/d4173c853231432d94f001e99d882ca7/8/GPL/openjdk-13.0.2_linux-x64_bin.tar.gz
# tar -zxvf openjdk-13.0.2_linux-x64_bin.tar.gz
# mv jdk-13.0.2/ /opt/
# vim /root/.bashrc
export JAVA_HOME=/opt/jdk-13.0.2
export PATH=$PATH:$JAVA_HOME/bin
# source /root/.bashrc
# echo $JAVA_HOME
/opt/jdk-13
  • JDK 1.8 卸载
# java -version
openjdk version "1.8.0_242"
OpenJDK Runtime Environment (build 1.8.0_242-8u242-b08-0ubuntu3~16.04-b08)
OpenJDK 64-Bit Server VM (build 25.242-b08, mixed mode)
# sudo apt-get remove openjdk*
  • JDK 13
# which java
/opt/jdk-13.0.2/bin/java
# java --version
openjdk 13.0.2 2020-01-14
OpenJDK Runtime Environment (build 13.0.2+8)
OpenJDK 64-Bit Server VM (build 13.0.2+8, mixed mode, sharing)

参考:

  1. JDK 13.0.2 General-Availability Release
  2. Install Oracle Java 13 on Ubuntu 18.04/16.04 & Debian 10/9

你可能感兴趣的:(ELK)