install java and jdk in linux code example
Example 1: installing java on linux
# install default JDK
sudo apt install default-jdk
# install default JRE
sudo apt install default-jre
# install specific JDK version
sudo apt install openjdk-17-jdk
# install specific JRE version
sudo apt install openjdk-17-jre
Example 2: install jdk linux
sudo apt install openjdk-8-jdk