Check whether Java is installed or not
As we know that there are various operating systems, to check whether Java is installed or not in Windows and Mac we use the following ways.
Windows Operating System:
There are several ways to find out whether Java is installed or not in windows they are:
Using Command Prompt:
First, open Command Prompt by using the Search tool or by clicking the “Windows + r” shortcut command. It shows like

if we type cmd in the search bar it opens the command prompt.
By typing the command like “java” in the Command Prompt,
C:\>java
If the Java is installed in the system, we get the output like,

If Java isn’t installed in the system, it shows the output like
‘java’ is not recognized as an internal or external command.
To check the version of Java, we can use the command like,
C:/java -version
java version “18.0.1.1” 2022-04-22
Java(TM) SE Runtime Environment (build 18.0.1.1+2-6)
Java Hotspot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)
Using Control Panel:
First, open the “Control panel” by using the Search bar which is in the taskbar or by going into the setting.

In the control panel, click on the program to view all installed programs and software in our system.

Then Click on “Programs and Features” option.

We will get the window like,

It will show all the installed software and programs. In that, if we find the “Java SE Development Kit” then the system is installed with the Java.
Mac Operating System:
There are several ways of finding out whether Java is installed or not in the Mac operating system they are,
Using Terminal:
First open the Terminal by using the Search tool. After opening the terminal type the Command like
$ java -version
If Java is installed, we get the output like
java version “18.0.1.1” 2022-04-22
Java(TM) SE Runtime Environment (build 18.0.1.1+2-6)
Java Hotspot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)
Using System Preferences:
There is another way of finding out whether the Java is installed or not in the Mac Operating System without using a terminal is using “System Preferences”.
Click on the Apple symbol which is on the top left corner of the window:

Then click on the System Preferences option.

If we find out the ‘Java’ Icon at the Bottom Left Corner, then the java is installed in our Mac Operating system. If there is no Java Icon, then Java is not installed in our system.