Java install openjdk on linux

w‮.ww‬lautturi.com
Java install openjdk on linux

To install the OpenJDK version of Java on a Linux distribution, you can use the package manager of your distribution. Here are the steps to install OpenJDK on some popular Linux distributions:

Ubuntu, Debian, and other Debian-based distributions:

  1. Add the PPA (personal package archive) for OpenJDK to your system:
sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:openjdk-r/ppa
  1. Update the package list:
sudo apt-get update
  1. Install OpenJDK:
sudo apt-get install openjdk-11-jdk
  1. Set the default Java version to Java 11:
sudo update-alternatives --config java
  1. Verify that Java 11 is installed and set as the default:
java -version

CentOS, Fedora, and other Red Hat-based distributions:

  1. Install the java-11-openjdk package:
sudo yum install java-11-openjdk
  1. Set the default Java version to Java 11:
sudo alternatives --set java /usr/lib/jvm/java-11-openjdk-11.0.10.x86_64/bin/java
  1. Verify that Java 11 is installed and set as the default:
java -version

Arch Linux:

  1. Install the jdk package:
sudo pacman -S jdk
  1. Set the default Java version to Java 11:
sudo archlinux-java set java-11-openjdk
  1. Verify that Java 11 is installed and set as the default:
java -version

For more information on installing Java on a Linux distribution, you can refer to the OpenJDK documentation or the Oracle documentation.

Created Time:2017-11-03 23:27:13  Author:lautturi