How to install Java JDK 22 on RHEL 8/9 | Install and configure Java JDK on RHEL/Redhat 9 in 2024

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys in this video we will see how to install Java jdk 22 on red hat Enterprise Linux 9 but the process is same for rhl 8 or 9 okay so first verify the currently installed Java version see I have installed Java open jdk 11 install the latest version you have to follow the steps click on activities open Firefox go to Google then search for Java downloads click on the first link that is Java downlo Downs Oracle okay I will keep this link in the video description see we have the jdk 22 21 and 17 the current and latest stable version is jdk 22 okay so we are going to install the latest one see here downloads for Linux Mac OS and windows click on Linux download the RPM Package C C for for rhl Fedora CVO Linux or Amazon Linux we have to download the RPM package right click on it copy go to the terminal sudo wet past that link and hit enter it will download the RPM package see it a size is 186 megabytes wait until this download completes once download is completed then we will install the this RPM package LS see we have the Java jdk bin RPM file okay contrl L to clear screen now install the RPM so give the command sudo RPM hyph then give the Java jdk file give the jdk 22 and hit enter see it is installing we have successfully installed Java jdk 22 now verify the Java version Java hyphen hyphen version see new Java version is the default version we want set older version we can set Pudo update Alternatives config Java see we have two versions 11 and 22 okay see if you give the one It Now default version will be the Java 11 LS now verify Java hyphen hyphen version see now version has been changed to 11 so to configure the latest one we have to run this command I will keep this command also in the video description then give the option for Java jdk 22 so for that is selection number two give the two and hit enter verify again Java Java version see we have set the Java jdk 22 is the current or default Java Version Control L to clear screen now let's create a sample Java program and compile it compile and run create the sudo or Nano what whatever the text editor that you are familiar with use that sudo VI first Java program do Java hit enter I to insert mode paste the following code I will keep the the sample code in the video description paste it save the file now compile this one Java C first Java program. Java now run the class name you don't know it LS see here we have the R2 class so run it Java R2 class we have successfully compiled and run the Java program suppose if you modify it let me modify again I want to add one more line shift system do out do print Ln now add some of two numbers put semicolon at the end of the statement and save the file now give the Java R schools but if you run this one it will give the same output let me but we have modified so after modification of java program every time we have to compile so run the Java C first then Java file hit enter now run the Java AR Scoles see the output has been shown here next we are going to see how to set the en variables for Java and rhl Echo dollar Java home see nothing is configured okay so we are going to configure Java home export first get the Java PA it is there even we can we have find it by running see this is the Java jvm directory copy up to here crl C to quit contr export Java _ home equals to in quotations paste that path see this is the path copy it up to here not the bin directory paste it close the cotations and hit enter now export path equals to dollar path colon dollar Java home then forward SL bin and hit enter and hit enter now Source the now Source The envirment Source SL Etc environment hit enter now Echo dollar Java _ home see we have successfully the Java and environment variables for Java even if you print EnV see here we have the Java home okay so we have successfully set the Java environment variables for Java okay so in this video we have seen how to download install and configure the Java jdk 22 on redard ENT Linux 9 but the process is same on all rhl versions okay then we have seen how to create a sample Java program and compile and run the Java program then we have seen how to set the environment variables for Java in rhl for more Java or Linux videos please subscribe my channel thank you
Info
Channel: r2schools
Views: 447
Rating: undefined out of 5
Keywords: Download and Install java jdk 22 on Redhat, How to install Java JDK 22 on RHEL 8, How to install Java JDK 22 on Redhat, How to install java jdk on Redhat, How to install java on Redhat, how to install jdk 22 in Redhat, download java jdk 22 for linux, how to install java in RHEL 9, Install Java jdk on RHEL 9, Install java in RHEL 9, java jdk 22 install on RHEL 8, java jdk 22 installation on Redhat, java jdk 22, Java tutorials, How to install java on redhat, java install on rhel
Id: p__xLtFzI0E
Channel Id: undefined
Length: 7min 15sec (435 seconds)
Published: Sun Apr 14 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.