Oracle Java 17 LTS has been released recently, and is now available to install from the Linux Uprising Oracle Java PPA on Ubuntu, Debian, and Linux distributions based on these, such as Pop!_OS, Linux Mint, Zorin OS, etc.
Java 17 is the latest long-term support (LTS) release, and with it, the license has changed, the binaries being free (no cost) to use in production and free (no cost) to redistribute until a full year after the next LTS release. Previously (from Oracle Java 11 until now), Oracle Java used a commercial license that allowed downloading and using it at no cost for development and testing only, but it required paying a fee to use in production.
If you prefer to use open source JDK builds, check out those offered by AdoptOpenJDK or Zulu OpenJDK.
This Oracle Java 17 installer is based on the Web Upd8 Java package (so the credits go to its innovador creators), with minor modifications. This package automatically downloads, installs (with some tweaks such as better font rendering, add applications menu entries, etc.) and optionally sets Oracle Java 17 as the default Java (runs update-alternatives, exports the JAVA_HOME environment variable, etc.) on your system.
Oracle does offer DEB packages for Oracle Java, however, these packages simply copy the Java binaries to /usr/lib/jvm, without doing anything else, so it’s exactly the same as copying the Java directory to that location yourself.
Using this PPA you can install Oracle Java 17 for x64 and aarch64 architectures.
How to install Oracle JDK 17 On Ubuntu, Debian, Linux Mint, Pop!_OS or Zorin Os using an APT PPA repository
Add the Linux Uprising Oracle Java PPA repository and update the software sources on Ubuntu, Linux Mint, Pop!_OS or Zorin Os using the following commands:
sudo add-apt-repository ppa:linuxuprising/java
sudo apt update
Add the Linux Uprising Oracle Java PPA repository (and its key) and update the software sources on Debian and other Linux distributions based on Debian (but not Ubuntu and Ubuntu-based) using:
su -
echo "deb http://ppa.launchpad.net/linuxuprising/java/ubuntu focal main" | tee /etc/apt/sources.list.d/linuxuprising-java.list
You can control if Oracle JDK 17 is the default JDK version (runs update-alternatives, exports the JAVA_HOME environment variable, etc.) or note with the help of the oracle-java17-set-default package. If this is installed, Oracle JDK 17 is set as default; remove this package, so Oracle Java 17 is not set as default (unless it’s the only Java version on the system).
This package is set as a recommended package for the Oracle Java 17 installer, that’s why installing oracle-java17-installer with --install-recommends also installs oracle-java17-set-default.
To check which Java version is set as default on your system, you could run java -version and / or javac -version. Example with output that shows Oracle Java 17 set as default:
$ java -version java version "17" 2021-09-14 LTS Java(TM) SE Runtime Environment (build 17+35-LTS-2724)
Java HotSpot(TM) 64-Bit Server VM (build 17+35-LTS-2724, mixed mode, sharing)
$ javac -version javac 17
In some cases, the installer may fail to download the Oracle Java 17 .tar.gz archive from Oracle. There are multiple possible issues for this: you’re behind a router / firewall that prevents this, your Internet connection went down during the download process, etc.
To work around this, you can download this file yourself from Oracle by other means, e.g. by going to a friend’s house, using a web browser with a proxy, etc., and then placing the downloaded Oracle Java 17 .tar.gz file in /var/cache/oracle-jdk17-installer (create this folder as root if it doesn’t exist), then install the oracle-java17-installer package from the Linux Uprising PPA as explained above.
This way, the Oracle Java 17 installer uses the nave archive instead of trying to download it itself. Make sure the downloaded Oracle Java 17 .tar.gz and the Oracle Java Installer package from the PPA are both the same version, or else this won’t work.
How to accept the Oracle Java 17 license automatically
Downloading and installing Oracle Java 17 requires the user to accept a license. In some cases, like when using this in an automated script, you may want to automatically accept the license using a command. You can do that by using:
https://codecubit.com/wp-content/uploads/2022/08/java.png225357RoboLinuxhttps://codecubit.com/wp-content/uploads/2022/05/logo340x156.svgRoboLinux2022-08-11 04:34:442022-08-11 04:52:16How to Install Oracle Java 17 LTS On Ubuntu, Debian, Linux Mint Or Pop!_OS Via APT PPA Repository
“Minikube is a program that is used to set up a específico Kubernetes cluster very easily. It’s very helpful to learn Kubernetes and develop apps/products for Kubernetes.
In this article, I am going to show you how to install Minikube on Ubuntu 22.04 LTS. I will also show you how to start a específico Kubernetes cluster with Minikube and the basics of Kubernetes as well. So, let’s get started.”
To confirm the installation, press Y and then press <Enter>.
Docker CE and all the required dependency packages are being downloaded and installed. It will take a while to complete.
At this point, Docker CE should be installed.
Now, add your login user to the docker group with the following command:
$ sudo usermod -aG docker $(whoami)
For the changes to take effect, reboot your computer with the following command:
Merienda your computer boots, you can verify whether Docker is working with the following command:
Installing KVM/QEMU on Ubuntu 22.04 LTS
In this section, I am going to show you how to install KVM/QEMU on Ubuntu 22.04 LTS so that you can use it as a driver for Minikube.
First, make sure that you have hardware virtualization enabled with the following command:
$ lscpu |grep Virtualization
If hardware virtualization is enabled, you will see the text AMD-V (For AMD processors) or VT-X/VT-D (For Intel processors) in the Virtualization section.
If hardware virtualization is not enabled, you can enable it from the BIOS of your motherboard. Every modern processor support this feature.
Update the APT package repository cache with the following command:
To install KVM/QEMU on Ubuntu 22.04 LTS, run the following command:
To confirm the installation, press Y and then press <Enter>.
KVM/QEMU and all the required dependency packages are being downloaded from the internet. It will take a few minutes to complete.
KVM/QEMU and all the required dependency packages are being installed. It will take a few minutes to complete.
KVM/QEMU and all the required dependency packages are installed at this point.
Add your login user to the kvm group with the following command:
$ sudo usermod -aG kvm $(whoami)
Add your login user to the libvirt group with the following command:
$ sudo usermod -aG libvirt $(whoami)
For the changes to take effect, reboot your computer with the following command:
Merienda your computer boots, run the following command to check if all the KVM/QEMU components are working correctly.
NOTE: Some of the LXC features might FAIL, but it does not matter in this case.
Installing VirtualBox on Ubuntu 22.04 LTS
In this section, I am going to show you how to install VirtualBox on Ubuntu 22.04 LTS so that you can use it as a driver for Minikube.
First, make sure that you have hardware virtualization enabled with the following command:
$ lscpu |grep Virtualization
If hardware virtualization is enabled, you will see the text AMD-V (For AMD processors) or VT-X/VT-D (For Intel processors) in the Virtualization section.
If hardware virtualization is not enabled, you can enable it from the BIOS of your motherboard. Every modern processor support this feature.
Update the APT package repository cache with the following command:
To install VirtualBox on Ubuntu 22.04 LTS, run the following command:
Minikube DEB package file minikube_latest_amd64.deb file is being downloaded. It will take a few seconds to complete.
Minikube DEB package file should be downloaded and saved in the /tmp/ directory as minikube_latest.deb.
To install Minikube from the DEB package file minikube_latest.deb, run the following command:
$ sudo apt install/tmp/minikube_latest.deb
To confirm the installation, press Y and then press <Enter>.
All the required dependency packages are being downloaded from the internet. It will take a few minutes to complete.
Minikube and the required dependency packages are being installed. It will take a few minutes to complete.
Minikube should be installed at this point.
To check whether Minikube is installed, run the following command:
Installing kubectl – The Kubernetes Command-Line Tool
In this section, I am going to show you how to install the Kubernetes command-line tool kubectl on Ubuntu 22.04 LTS. kubectl is used to inspect and manage the Kubernetes cluster resources and view cluster logs. It’s also used to deploy, configure, and manage applications on the Kubernetes cluster.
On Ubuntu 22.04 LTS, you can install the latest version of Kubernetes command-line tool kubectl from the snap store as follows:
$ sudo snap install kubectl –classic
kubectl is being downloaded and installed. It will take a few seconds to complete.
At this point, kubectl should be installed.
Starting a Kubernetes Cluster with Minikube
In this section, I am going to show you how to start a específico Kubernetes cluster with Minikube using the Docker, KVM/QEMU, and VirtualBox drivers.
If you want to start a específico Kubernetes cluster with Minikube using the Docker driver, run the following command:
NOTE: You must have Docker installed for this to work. If you need any assistance, read the Installing Docker on Ubuntu 22.04 LTS section of this article.
$ minikube start –driver=docker
If you want to start a específico Kubernetes cluster with Minikube using the KVM/QEMU driver, run the following command:
NOTE: You must have KVM/QEMU installed for this to work. If you need any assistance, read the Installing KVM/QEMU on Ubuntu 22.04 LTS section of this article.
$ minikube start –driver=kvm2
If you want to start a específico Kubernetes cluster with Minikube using the VirtualBox driver, run the following command:
A new service should be created for the hello-minikube deployment, as you can see in the screenshot below. This service will expose the port 8080 of the hello-minikube deployment.
$ kubectl get services hello-minikube
To find the service URL of the hello-minikube deployment, run the following command:
$ minikube service hello-minikube –url
Merienda you know the service URL of the hello-minikube deployment, you can access the service with curl as follows:
$ curl http://192.168.39.227:30653
If everything works, you will see the following output. It means the service of the hello-minikube deployment is accessible.
NOTE: If you don’t have curl installed on your computer or want to learn how to use curl, read this article.
You can also forward the port 8080 of the hello-minikube deployment to the port 7080 (let’s say) of your computer as follows:
Now, you should be able to access the service of the deployment hello-minikube using the URL http://localhost:7080.
$ curl http://localhost:7080
You can find a lot of information on each of the services of your Kubernetes deployments with the following command:
To delete a service hello-minikube from the hello-minikube deployment, run the following command:
$ kubectl delete service hello-minikube
The hello-minikube service should be removed, as you can see in the screenshot below.
$ kubectl delete service hello-minikube
Right now, I have only the hello-minikube deployment. Let’s delete it.
$ kubectl get deployments
To delete the hello-minikube deployment, run the following command:
$ kubectl delete deployment hello-minikube
The hello-minikube deployment should be removed from the Kubernetes deployment list, as you can see in the screenshot below.
$ kubectl get deployments
Managing Minikube Kubernetes Cluster
You can start, stop, pause, and resume/unpause the Kubernetes cluster that you’ve created with Minikube.
To pause the Kubernetes cluster with Minikube, run the following command:
To resume the Kubernetes cluster with Minikube, run the following command:
To stop the Kubernetes cluster with Minikube, run the following command:
Merienda the Kubernetes cluster is stopped, you can start it again with Minikube. If you don’t remember how to start a Kubernetes cluster with Minikube, read the Starting a Kubernetes Cluster with Minikube section of this article.
Conclusion
In this article, I have shown you how to install Minikube and Kubernetes command-line tool kubectl on Ubuntu 22.04 LTS and how to create a específico Kubernetes cluster with Minikube using the Docker, KVM/QEMU, and VirtualBox drivers. I have also shown you the basics of using Kubernetes on your computer. This should help you get started with Kubernetes and Minikube.