There are multiple ways to check if Java is installed on a Windows 10, macOS X, or Linux machine. The simplest way is to use the command-line tool.

Open your command-line tool and type the following command:

$ java -version

If Java is installed and PATH is configured correctly, you should see output similar to the following:

openjdk version "11.0.2" 2019-01-15
OpenJDK Runtime Environment 18.9 (build 11.0.2+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.2+9, mixed mode)

If Java is not installed or misconfigured, you'll see the following output:

zsh: command not found: java

The above message is displayed by a macOS X machine. You may see a different message depending on the operating system used and the Java version installed.

✌️ Like this article? Follow me on Twitter and LinkedIn. You can also subscribe to RSS Feed.