Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

Java Installation Guide in Linux & Windows


DOWNLOAD OPEN JDK & JRE JAVA PACKAGE FROM – https://jdk.java.net/archive/


Download and Install JDK/JRE 7 in Centos & RHEL

$ su -c "yum install java-1.7.0-openjdk"	# JRE Version
$ su -c "yum install java-1.7.0-openjdk-devel"	# JDK versionCode language: PHP (php)

Download and Install JDK/JRE 8 in Centos & RHEL

$ su -c "yum install java-1.8.0-openjdk"	# JRE Version
$ su -c "yum install java-1.8.0-openjdk-devel"	# JDK versionCode language: PHP (php)

Download and Install JDK/JRE 9 in Centos & RHEL

$ su -c "yum install java-1.9.0-openjdk"	# JRE Version
$ su -c "yum install java-1.9.0-openjdk-devel"	# JDK versionCode language: PHP (php)

Download and Install JDK/JRE 7 in Ubuntu

$ sudo apt-get install openjdk-7-jre		# JRE Version
$ sudo apt-get install openjdk-7-jdk		# JDK versionCode language: JavaScript (javascript)

Download and Install JDK/JRE 8 in Ubuntu

sudo apt-get install openjdk-8-jre		# JRE Version
sudo apt-get install openjdk-8-jdk		# JDK versionCode language: JavaScript (javascript)

Download and Install JDK/JRE 9 in Ubuntu

sudo apt-get install openjdk-9-jre		# JRE Version
sudo apt-get install openjdk-9-jdk		# JDK version
Code language: JavaScript (javascript)

Download and Install JDK/JRE 11 in RHEL/CENTOS

# Install New Version
$ yum install java-11-openjdk-develCode language: PHP (php)

Download and Install JDK/JRE 11 in Ubuntu


$ sudo apt-get update
$ sudo apt-get install openjdk-11-jdk -y
$ apt install openjdk-11-jdk-headless -y Code language: JavaScript (javascript)

Download and Install JDK/JRE 17 in Ubuntu


$ sudo apt update
$ sudo apt install openjdk-17-jdk
$ sudo apt install openjdk-17-jre
$ java --version

Download and Install JDK/JRE 17 in Centos / RHEL


$ sudo yum install java-17-openjdk
$ sudo yum install java-17-openjdk-devel
$ java -version

Download and Install JDK/JRE 21 in Centos / RHEL


sudo yum install java-21-openjdk            # Installs the JRE
sudo yum install java-21-openjdk-devel      # Installs the JDK (compiler and dev tools)Code language: PHP (php)

Download and Install JDK/JRE 21 in Ubuntu


sudo apt update && sudo apt upgrade -y
sudo apt install openjdk-21-jdk -y

How to Remove Java Installed?


# Remove old version
$ java -version
$ yum list installed | grep java
$ yum remove java-1.7.0-openjdk.x86_64
$ yum remove java-1.7.0-openjdk-headless.x86_64
$ yum remove java-1.8.0-openjdk.x86_64
$ yum list installed | grep java
$ yum remove java-1.8.0-openjdk-headless.x86_64
$ java -versionCode language: PHP (php)

How to download Open Java Packages in Linux?

Location - https://openjdk.java.net/install/

Oracle's OpenJDK JDK binaries for Windows, macOS, and Linux are available on release-specific pages of jdk.java.net as .tar.gz or .zip archives.

As an example, the archives for JDK 13 may be found on jdk.java.net/13 and may be extracted on the command line using following depending on the archive type.

$ tar xvf openjdk-13*_bin.tar.gz
or
$ unzip openjdk-13*_bin.zip
Code language: PHP (php)

How to set JAVA HOME in Linux System?

$ export JAVA_HOME=/opt/jdk1.8.0_144/
$ export PATH=/opt/jdk1.8.0_144/bin:$PATH;Code language: JavaScript (javascript)

How to set JAVA HOME env in Windows?


$ set JAVA_HOME "C:\Program Files\Java\jdk1.8.0"
$ set PATH "%PATH%;%JAVA_HOME%\bin";

$ setx JAVA_HOME "C:\Program Files\Java\jdk1.8.0"
$ setx PATH "%PATH%;%JAVA_HOME%\bin";
Code language: PHP (php)

Command to set default Java version in Linux?


$ sudo alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
-----------------------------------------------
*+ 1           java-1.8.0-openjdk.x86_64 (/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.332.b09-1.el7_9.x86_64/jre/bin/java)
   2           java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-11.0.15.0.9-2.el7_9.x86_64/bin/java)

Enter to keep the current selection[+], or type selection number: 2
[root@ip-10-157-160-63 jenkins]# java -version

Also, these commands are helpful
$ sudo update-alternatives --config java
$ sudo update-alternatives --config javac
$ sudo update-alternatives --config java_homeCode language: PHP (php)

How to install Open JDK Java in Windows?


- Download from https://jdk.java.net/archive/
- Extract a files of jdk-11.0.2 into C:\tools\Java\
- Results should be like C:\tools\Java\jdk-11.0.2
- Add C:\tools\Java\jdk-11.0.2\bin into env "path"
- Go to cmd and type $ java --version
- Set JAVA_HOME var into env. Path should be "C:\tools\Java\jdk-11.0.2"Code language: JavaScript (javascript)

How to Set JAVA_HOME in windows?

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
I'm Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms. I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.

Related Posts

How to Use gsh to Run Linux Commands Across Multiple Servers

gsh (Group Shell) lets you execute one command across many Linux hosts from a single terminal. This guide explains host grouping with /etc/ghosts, core options, and practical command patterns.

Read More

Linux System Administrator Responsibilities: Daily Operations, Privileges, and Best Practices

Linux system administrators are responsible for server reliability, security, access control, patching, backups, and troubleshooting. This updated guide maps those responsibilities to practical workflows and command examples.

Read More

Common UNIX Commands and Utilities: Practical Reference for DevOps and Sysadmin Work

A structured UNIX command reference organized by real operational tasks: discovery, files, processes, networking, text processing, and job control. Includes C-shell notes, comparison tables, and practical command examples.

Read More

UNIX sed Quick Reference: Print and Delete Lines with Address and Pattern Ranges

Use this sed quick reference to print or delete exact lines, ranges, and regex matches without opening an editor. It also highlights GNU vs POSIX differences and safer in-place editing patterns.

Read More

Install Subversion (SVN) on Linux: Package Install, Source Build, Apache Setup, and Authentication

Learn how to install Subversion on Linux, create a repository, and publish it through Apache with user authentication. This revised guide includes both package-based and legacy source-build paths with practical commands.

Read More

Unix grep Quick Reference: Patterns, Options, and Real Command Examples

grep is the core Unix command for searching text by pattern across files or standard input. This revised quick reference covers syntax, high-value options, and practical examples you can use immediately.

Read More
Subscribe
Notify of
guest
1 Comment
Newest
Oldest Most Voted
mahesh
mahesh
3 years ago

[root@ip-172-31-24-185 opt]# su -c “yum install java-1.8.0-openjdk-devel”
Last metadata expiration check: 7:20:54 ago on Sat Jun 3 12:01:43 2023.
No match for argument: java-1.8.0-openjdk-devel
Error: Unable to find a match: java-1.8.0-openjdk-devel

1
0
Would love your thoughts, please comment.x
()
x